Jesus already knew the answer to that question (Mark 7,27-30). He is God.
For that matter, Jesus was the only one of them who knew at that time that He is God.
Then why did Jesus ask the question?
Not for His benefit but for their benefit. For our benefit.
It shows us that Peter learned it from heaven (Matthew 16,17), that Peter knew about Jesus not just from paying attention and doing his homework but because of help from heaven.
And the subsequent exchange (Mark 8,31-33) demonstrates that Peter is not immune from the deleterious influence of hell, especially when left to his own devices.
The unfolding of Our Lord’s agony and arrest in the garden and subsequent shameful interrogation showed Peter subject to the same conflicting currents. After his repeated denials of knowing Jesus (Mark 15,66-72) at the moment the cock crows, Jesus’ words (Mark 15,30) come back to Peter and he is reduced to tears of contrition.
Will Peter be perfect? No.
But will he ruin God’s work? No.
Will he ignore a prompt from heaven? Not ever.
Will he get to the point of being beyond criticism? Not likely.
But will he fail in any significant way? No.
Will any of this be new? No.
And will any of this change? Not if Jesus is God and His promises (Matthew 16,18-20 and Luke 23,31-32 and John 21,3-19) mean anything.
Jesus’ choice of Peter as head teacher and chief fisherman was deliberate and should shape every Bible-reader’s Christian obedience to and reasonable expectations of Peter and his successors.
The scoundrels that have sat on that chair, as much as the saints, prove true the promise of Our Lord in matters of necessity, in matters of doctrine. In matters personal, prudential and political the Holy Spirit does damage control, then and now.
It explains why full-blooded Christians both rely on the Pope serenely and pray for him constantly.