Gita 04.13 explained
cātur-varṇyaṁ mayā sṛṣṭaṁ
tasya kartāram api māṁ
viddhy akartāram avyayam
cātuḥ–varṇyam — the four divisions of human society; mayā — by Me; sṛṣṭam — created; guṇa — of quality; karma — and work; vibhāgaśaḥ — in terms of division; tasya — of that; kartāram — the father; api — although; mām — Me; viddhi — you may know; akartāram — as the nondoer; avyayam — unchangeable.
According to the three modes of material nature and the work associated with them, the four divisions of human society are created by Me. And although I am the creator of this system, you should know that I am yet the nondoer, being unchangeable.
For Such people as mentioned in 4.12, Krishna has created a system by which they will elevated systametically
In west someone can say cast system is not there but these are class of people present everywhere even in class room, factories also it can be found.
Provides a social structure for spiritual advancement:
Ashrama: Provides a timewise progression in one’s spiritual commitment
Varna: Provides for one’s material needs in the least uncomplicated and the most harmonious way according to one’s psychophysical nature
If individual’s struggle for spirituality is support by social structure then it is easy, for example a student wanted to become Doctor but no social structure is available, then it is very difficult to become, he has to do everything by his own.
Today it is very difficult to choose from multiple career option available but earlier it was varna system it was very easy for a person to acquire his career has they will learn from childhood. In today’s time a child nature could be something else but they will still select engineering or medicine, but there interest Guna and Karma is something else.
Guna refers to quality and karma refers to activity.
Krishna is the one who had made this system, but He is not the doer which means that he has not put people as Brahman or sudra it is based on their Karma, Krishna is not partial but He is reciprocal.
Sometimes a school moves all good students in one section particularly in higher class and low performing students in one section also they provide better facilities to the section where all good students are, so school is not responsible for putting all good students in one section, school has just created the rule and based on students performance they are falling in these sections.
Similarly judge is giving judgement based on established rules and whether a person gets punishment or not is based on his own deeds and not based on Judge.