Several questions come to mind as we read this passage (John 21:15-17):
Why did Jesus ask Peter three times, "Do you love me?" Because Peter denied him three times.
Why did He do this publicly? Because Peter denied him publicly. The other disciples needed to hear Peter openly declare his love for Christ. Without hearing those words, the doubts would linger forever.
The man who had been so boastful, so sure of himself, so confident of his own courage, is now thoroughly humbled. Jesus' first question - "Do you love me more than these?" (John 21:15) - was a subtle reminder of his previous boast to be more loyal than the other disciples (Matthew 26:33). In his reply Peter declares his love for Christ, but he refuses to compare himself with anyone else. As painful as this was, it was absolutely necessary. Jesus is cleaning the wound so that it might be properly healed. He is getting rid of Peter's guilt and shame by dealing with it openly.
Consider what Christ doesn't do. He doesn't try to make Peter feel guilty. He doesn't humiliate publicly. He doesn't ask him, "Are you sorry for what you did?" He doesn't make him promise to do better. He just asks one question: "Do you love me?"
When Christ asks the question the third time, Peter's heart is grieved and he blurts out, "Lord, you know all things." (John 21:17). With those words Peter renounces all his self-confidence. On that fateful night in the Upper Room, he thought he knew himself but he didn't. Now he's not so sure. He doesn't even trust his own heart; instead he trusts in the Lord who knows all things. This is a mighty step forward in Christian growth. It is a great advance to come to the place where you can say with conviction, "My trust is in the Lord alone." Sometimes we have to hit bottom and hit it hard before we can say those words.
No doubt Peter loved Jesus more after his fall than before. No one loves like that the one who has experienced God's grace firsthand.
Taken from "Do You Love Me?" by Keep Believing Ministries (used by permission).