Because Peter had denied Christ three times and abandoned Him on the day of His crucifixion and death, Jesus had good reason to question whether Peter loved Him. Nevertheless, barely a month later, Peter was hurt and probably surprised that Jesus questioned his love (Jn 21:17).
We human beings have an astounding and fearful capacity to deceive ourselves about love. How many married people commit adultery and still think they love their spouses! How many Christians disobey the Lord, commit mortal sins, and say they love the Lord! (see Jn 15:10) Almost every parent thinks he loves his children, even if he doesn't spend much time with them.
Jesus, in His mercy, challenges our self-deception concerning our love for Him. He commands us to love, feed, and lay down our lives for His sheep. If we do this, our love for the Good Shepherd is genuine (see Jn 21:17). However, we naturally don't want to lay down our lives. Therefore, we need the Holy Spirit to pour out love in our hearts (Rm 5:5). Only love in the Spirit will break the hold of selfishness on us and free us to lay down our lives in love for the sheep. Only in the Spirit can we love Jesus. Come, Holy Spirit!