Jesus saith to them: but whom do you say that I am? Here the faith of the disciples is sought out. And first, the question is set forth; second, the response; third, the approval. The second is at Peter answering; the third is at and Jesus answering etc. Jesus saith to them: but whom do you say that I am? As if to say: so say the crowds; but because more has been entrusted to you, therefore more is required of you. You have seen the miracles, therefore you ought to have a higher opinion. But why did he ask? Did he not know? Indeed he knew, but he wished them to merit by their confession; Rom. ...10:10: with the heart we believe unto justice, but with the mouth confession is made unto salvation. Hence they are more meritorious, the more they are set apart, and just as to crowds knowing lower things, they should not answer with greater things, and therefore etc.
Source: Commentary on Matthew