Srimad Bhagavatam Canto 06, Chapter 01, Text 54

SB 6.1.54

labdhva nimittam avyaktam
 vyaktavyaktam bhavaty uta
yatha-yoni yatha-bijam
 svabhavena baliyasa
 
Translation by His Divine Grace A. C. Bhaktivedanta Swami Srila Prabhupada: 
 
The fruitive activities a living being performs, whether pious or impious, are the unseen cause for the fulfillment of his desires. This unseen cause is the root for the living entity’s different bodies. Because of his intense desire, the living entity takes birth in a particular family and receives a body which is either like that of his mother or like that of his father. The gross and subtle bodies are created according to his desire.
 
Purport by His Divine Grace A. C. Bhaktivedanta Swami Srila Prabhupada: 
 
The gross body is a product of the subtle body. As stated in Bhagavad-gita (8.6):
 
yam yam vapi smaran bhavam
 tyajaty ante kalevaram
tam tam evaiti kaunteya
 sada tad-bhava-bhavitah
 
“Whatever state of being one remembers when he quits his body, that state he will attain without fail.” The atmosphere of the subtle body at the time of death is created by the activities of the gross body. Thus the gross body acts during one’s lifetime, and the subtle body acts at the time of death. The subtle body, which is called linga, the body of desire, is the background for the development of a particular type of gross body, which is either like that of one’s mother or like that of one’s father. According to the Rg Veda, if at the time of sex the secretions of the mother are more profuse than those of the father, the child will receive a female body, and if the secretions of the father are more profuse than those of the mother, the child will receive a male body. These are the subtle laws of nature, which act according to the desire of the living entity. If a human being is taught to change his subtle body by developing a consciousness of Krsna, at the time of death the subtle body will create a gross body in which he will be a devotee of Krsna, or if he is still more perfect, he will not take another material body but will immediately get a spiritual body and thus return home, back to Godhead. This is the process of the transmigration of the soul. Therefore instead of trying to unite human society through pacts for sense gratification that can never be achieved, it is clearly desirable to teach people how to become Krsna conscious and return home, back to Godhead. This is true now and, indeed, at any time.
Srimad Bhagavatam Canto 06, Chapter 01, Text 53
Srimad Bhagavatam Canto 06, Chapter 01, Text 55