Normally when we ask a question we use helping verb before the subject. For example

Where have you come from?
But when we add a question or make another statement before this question then the position of helping verb shifts to the position after the subject.

Could you tell me where you have come from?

Where is he?
Do you know where he is?
Why did he come?
Do you know why he came?
What do you mean?
Please explain what you mean.
Why was he shouting?
I wonder why he was shouting.