God did not ask questions because He did not know the answers. He was not trying to figure out whether Adam was hiding in one or another of the trees. Later in the account of Cain and Abel when Cain was displeased that his offering was rejected, God asked him a series of questions.
So in both those incidences God asked a lot of questions.
In II Samuel 12:9, God asked David through Nathan, Why did you despise the word of the Lord? by doing what is evil in His eyes. In Isaiah 6:8, God asked Isaiah, Whom shall I send, and who will go for Us? And in Matthew 16:15, the Lord asked, Who do you say I am? The apostle John recorded many of Christ's questions as well. God asks questions to get us to face the situation. He asks us, we have to answer, and whatever we answer better be the truth. And then even if we answer the truth, often we have condemned ourselves, but that is one of the main reasons God asks questions - to get us to face the situation ourselves to more deeply realize what we have done.
This is what Jesus asks us when we have been trying to go it on our own, Have you been successful? Are you satisfied? Questions like that. He asks these questions through His inspired written Word so that we might recognize our hunger, need, failure, and need to turn to Him.
And this is the first biblical example of human conflict. We see the underlying attitude that drives conflict between two people: prideful jealousy, envy, and self-seeking. If in our heart and mind we have any ill will towards anyone else in the church, the root is Satan's spirit of envy, pride, and jealousy. Behind every single thought or negative word spoken about someone else is a desire to elevate ourselves. We want more position, we want more recognition, we want more possessions.
And we see here, as we examined a few weeks back, our words, our thoughts, our actions simply mirror what is in our hearts. When we speak against or do something against a brother or sister in the church, it is because of what is in our hearts. Evil, just like Cain. In there is an underlying prideful jealousy or envy. When we speak negative words, we are murdering our brother or sister. That is the complete opposite of working, serving, guarding, protecting, to build up.
Cain used his power to murder his brother Abel. And what grew out of this is called in the Bible the way of Cain. We will not go into that. Cain was the leader and was doing things that subverted every purpose that God gave to mankind.