Joseph Campbell can explain this so much better than I can so I'm going to quote you from the text that I have.
Now, the Buddha figure is like that of the Christ; of course, 500 years earlier....The Buddha also goes into the forest, has conferences with the leading gurus of the day, he goes past them, He comes to the bo tree, the Tree of Illumination, undergoes three temptations. They’re not the same temptations, but they are three temptations.
The Power of Myth