According to Vedanta, there are multiple theories. One is that the souls, the up and the selves, they are coeval with God. Or even deeper answer is, you and God are actually one reality. Why did God create? Because he was bored. He wanted to play. And now not God is searching for who am I? What's going on? And that's this universe. That's what you are.
Swami Sarvapriyananda teaches Chapter 10 Verses 4-6 of the Bhagavad Gita. In this series of talks, Swami Sarvapriyananda unfolds the highest truths of Vedanta through the study of the Bhagavad Gita (The Song of God).