Chapter IV Sloka 13

catuvR{y¡ mya s&ò< gu[kmRiv-agz>,
tSy ktaRrmip ma< ivÏ(ktaRrmVyym!.

c˜turvarõyaÕ may˜ s®ÿ÷aÕ 
guõakarmavibh˜gaþa× | 
tasya kart˜ramapi m˜Õ 
viddhyakart˜ramavyayam ( 4|13)||

The fourfold caste has been created by Me according to the differentiation of Guna and Karma; though I am the author thereof, know Me as non-doer and immutable.
The four castes (Brahmana, Kshatriya, Vaishya and Sudra) are classified according to the differentiation of Guna and Karma. In a Brahmana, Sattva predominates. He possesses self-restraint, purity, serenity, straightforwardness, devotion, etc. In a Kshatriya, Rajas predominates. He possesses prowess, splendour, firmness, dexterity, generosity and the nature of a ruler. In a Vaishya, Rajas predominates and Tamas is subordinate to Rajas. He does the duty of ploughing, protection of cattle and trade. In a Sudra Tamas predominates and Rajas is subordinate to Tamas. He does service to the other three castes. Human temperaments and tendencies vary according to the Gunas.
Though the Lord is the author of the caste system, yet He is not the author as He is the non-doer. He is not subject to Samsara. Really Maya does everything. Maya is the real author. Society can exist in a flourishing state if the four castes do their duties properly. Otherwise there will be chaos, rupture and fighting. 
(Cf . XVIII. 41)