Ezekiel 34 says YHWH himself will shepherd his sheep and also promises a Davidic shepherd over them.
Ezekiel 34:11-24; Psalm 23:1 are the principal backgrounds.
The flock Jesus called his own in John 10 remains his own after the resurrection; Peter serves as an under-shepherd commissioned by Jesus.
The scene reinforces Jesus' fulfillment of the divine-shepherd role and his continuing authority over his people.
Peter finally says, 'Lord, you know everything; you know that I love you.'