Bramha followed the manual given by God, Vedas and worked accordingly for a whole year!
Here’s an example instruction of one of his tasks…
“Vajrapaani purandaraha“, one who holds vajram (a diamond) in his hand is Indra
Above is a statement in Vedas that Brahma tasked on to create a body for Indra. Vedas contain underlying rules on how to create the vajram, a hand, a shoulder that acts as base for the hand, a body that acts as base for the shoulder, senses, manas, intellect (buddhi), body that holds everything together for Indra to carry out his purpose in existence. When Brahma finishes his task, God becomes the underlying source of energy for Indra to begin functioning.
Same process holds true for all the souls, including us all!
Each one of us gets a body that fits our purpose in this existence.