According to the Bhagavad-gita, whatever we think of at the time of death determines what sort of body we'll take next. And of course what we think of at death depends largely on what we thought about and what we did during our life. The process is subtle, because the mind is subtle.
The Bhagavad-gita explains that the mind, at death, carries with it subtle conceptions, just as the air carries aromas. And these subtle thoughts are what shape the next body. They determine what sort of eyes one will have, what nose, ears, and tongue, what sort of hands and legs and other bodily features. These all assemble around the mind.
The Vedic writings tell us, also, that our karma— we deserve for our past acts— not only from what we have done in the present life but from past lives as well. My present birth, then, is an outcome of what I have thought and what I have done in the past.
Are human beings always reborn as human beings? According to the Vedic literature, no. Some are, but others are promoted to still higher forms, forms beyond our present experience, and others are degraded to lower species.
Sometimes, for example, we see a person living just like a pig—, sloppy, gluttonous. We may think he even looks like a pig. According to the Vedic teachings, such a person, already practically a pig in consciousness, may get the body of a pig in his next life.
The Vedic writings say that there are 8,400,000 species, most of them lower than human. In the lower species, the living beings always act precisely as nature dictates. They have no choice. A horse always acts like a horse, a tree like a tree. You never see a tiger stealing oranges.
And so the living beings in lower species always advance to species higher. Slowly, one step at a time, they are promoted by nature from one species to the next.
But human life affords us greater choice. We can live in harmony with nature's laws, or we can violate them. And accordingly we may be promoted or degraded. The human life is therefore meant for spiritual realization and for gaining freedom from the cycle of birth and death. No other species offers us this opportunity.