Then Satan entered into Judas called Iscariot, who was of the number of the twelve. He went away and conferred with the chief priests and officers how he might betray him to them. (Luke 22:3-4)
But behold, the hand of him who betrays me is with me on the table. (Luke 22:21)
While he was still speaking, there came a crowd, and the man called Judas, one of the twelve, was leading them. He drew near to Jesus to kiss him, but Jesus said to him, “Judas, would you betray the Son of Man with a kiss?” (Luke 22:47-48)
Jesus said, “I tell you, Peter, the rooster will not crow this day, until you deny three times that you know me.” (Luke 22:34)
But Peter said, “Man, I do not know what you are talking about.” And immediately, while he was still speaking, the rooster crowed. And the Lord turned and looked at Peter. And Peter remembered the saying of the Lord, how he had said to him, “Before the rooster crows today, you will deny me three times.” (Luke 22:60-61)
Jesus knew these betrayals were going to happen. He knew that Peter would be restored. But none of that would make it hurt any less.
I'm easily wounded if I find out an aquanitance has said something slightly negatively about me - let alone betrayal by a friend. When one of your friends who has been with you for the last three years - hearing the teaching, seeing the miracles, having the parables explained, spending time with you, going out on the mission trips - when he turns round and betrays you for money, that hurts. When someone who has just said they are willing to die for you denies knowing you 3 times for the sake of their own safety, it stings.
If we experience betrayal from a friend, we know Jesus has also experienced it. He knows what it is like. Not only that, the One who is comforting us when we feel betrayed is the One that we have betrayed! We have betrayed him, and yet he forgives us and loves us.