Why would Jesus—who was perfect—need forty days of fasting? Hebrews 5:8 says that "Jesus learned obedience through what he suffered." Even Christ himself learned through suffering, particularly in that time in the desert. There's something that happened with the Holy Spirit in the life of Jesus in those forty days.
In Luke 3 we hear about Jesus' baptism. Verses 21 and 22 say this: "When all the people were being baptized, Jesus was baptized, too. And as he was praying, heaven was opened and the Holy Spirit descended on him in bodily form. And a voice came from heaven saying, 'You are my Son, whom I love. With you I am well pleased.'" So the baptism of Jesus the Spirit comes down visibly, tangibly into his life as a dove. And the voice of God speaks words of total affirmation: You're my Son. You're the one I love. Everything about you pleases my heart. Luke 4:1, which follows Jesus' baptism immediately: "Jesus, full of the Holy Spirit, returned from the Jordan and was led by the Spirit into the desert where for forty days he was tempted by the devil. He ate nothing during those days, and at the end of them he was hungry. And then the devil came."
I think that God puts every Christian through three tests and three temptations. Jesus, too, had to face three tests, followed by three temptations. First, Jesus had to experience life with the seeming loss of privilege. He's heard God say to him, "You're my Son. I love you. I'm pleased with you," but for forty days he walks in a desert where he loses the sense that he has attained some kind of status because of that. He loses privilege. The second test Jesus goes through is the seeming loss of provision. There is nothing to eat out there. There's no place to sleep. And the third test Jesus faces is the seeming loss of protection. The devil has wide open access to him.
And then there are three temptations on the heel of these tests. The devil comes and says: "Man, you look hungry. Looks like God's not really treating you well here. Don't you love bread when it comes fresh out of the oven? I mean, don't you just love it when you split it open and you let that cold butter melt into the texture of the bread? Don't you want some now, Jesus?" He says, "Why don't you go onto the roof, way up high, and jump and let the angels come and catch you." He says, "Why don't you bow down and worship me, and I'll give you all the kingdoms of the earth."
Here is what is at the essence of these three temptations. First, the temptation by Satan to turn the stone into bread is a temptation to define ourselves by what we can do—by power. Second is the temptation to define ourselves by how others see us. If Jesus leapt off the building and was saved by angels, people would know clearly that he was God's chosen one. This is a temptation to define ourselves by status. And the third temptation is to define ourselves by what we have. Satan offers Jesus all the kingdoms of the earth; he's tempting Jesus to define himself by his possessions.
You see, what happens when we define ourselves by any of those things is that God ends up merely on the periphery—if even in the picture at all—and who is at the center of a life like that? We are. Jesus faces the three tests of removal in the desert—the loss of privilege, the loss of provision, and the loss of protection—and then the three corresponding temptations: to define himself by what he does, to define himself by what others think of him, and to define himself by what he has. Jesus says No to the Devil, No to self pity, No to feeling he's a victim. And in every instance he says Yes to God. Yes ,God.