This is a question with far-reaching implications. The interpretative problem is how to reconcile two biblical passages:
“Let no one say when he is tempted, ‘I am being tempted by God’; for God cannot be tempted by evil, and He Himself does not tempt anyone” (James 1:13).
Jesus is the Son of God, part of the eternal triune godhead. Therefore, being God, it would appear Jesus “cannot be tempted by evil.”
“For we do not have a high priest who cannot sympathize with our weaknesses, but One who has been tempted in all things as we are, yet without sin” (Hebrews 4:15).
So, since Jesus is God He cannot be tempted by evil, yet He has been tempted in every way we are (and surely we are tempted by evil!). This is one of many paradoxes in Scripture. Paradoxes are not contradictions, but seeming or apparent contradictions that are unresolved in our minds, but resolved in God’s.
Some translations of Psalm 106:13-15 say “God was tempted” by the rebellion of His people in the wilderness. The better translation is probably tested, or put to the test. His people essentially tested whether God's character was consistent and His promise of judgment would be carried out for their sin. As the passage shows, it was indeed carried out. The word “tempted” would be misleading if we think it meant God was drawn toward being inconsistent with His own holiness. He wasn’t. Someone could have “tested” Einstein by giving him a quiz with second grade addition and subtraction, but the fact that the teacher would give him a test doesn't mean there would be any doubt about whether or not he would pass it.
Christ was tempted in that He had sinful options presented to Him, just as God did when He was tested/tempted in the wilderness by the rebellion of His people. But as God cannot be tempted (drawn toward evil), Jesus was not drawn toward the evil of disobeying His father, but He was drawn toward the good of having bread when He was hungry, and the good of not enduring unnecessary suffering (Luke 22:42).
We are accustomed to believing that in order for human battles and sports competitions to be real, both sides must be capable of losing. God and Satan are at war, but there is no possibility God will lose. Christ’s victory over Satan wasn’t just possible but absolutely certain.
That doesn’t mean the war is not real, nor does it mean it cannot be costly to the winner. Obviously Christ’s redemptive work was costly in the extreme. Satan’s head was crushed but Christ’s heel was badly bruised. At one point Christ’s head, by all appearances, was permanently crushed by death. That's how real the battle was.
Christ was fully capable of suffering, even though not capable of sinning. The Greek words for trial and temptation come from the same root, and in fact the same word is used interchangeably for both. But trials usually come from the outside, and temptations are prompted by the outside but succumbed to on the inside. Christ was tempted like we are in the sense that as He faced life’s full hardships, including temptations in the form of wanting to avoid suffering if He could do so while remaining righteous. He genuinely desired to avoid pain and hunger, and underwent suffering like we do—and even far greater suffering.
It’s possible for a rowboat to genuinely attack a battleship, even though it is impossible for the rowboat to conquer the battleship. Jesus was truly tempted by the devil in the same way that a battleship can be truly attacked by a rowboat. Of course, He was genuinely hurt by His enemies, so by analogy maybe we could say the rowboat’s archers can successfully hit the captain and crew of the battleship with their arrows.
For the attack of Christ's temptation to be real does not require that the attack has the capacity to succeed. Jesus was genuinely tempted, but that does not mean He had a susceptibility to sin. Unlike us in our present state, He had and has a permanently incorruptible nature.
That’s the only way we can know that there will never be another fall, another sin after the resurrection, since we will fully have the very righteousness of Christ. Because He cannot sin and has never been able to sin, we too will never be able to sin once we are glorified and fully like Him.
In other words, the capacity to sin was there in Adam and Eve even before they sinned. Sin for us now is not just a capacity but also a compulsion (Romans 7:19-25). Not that we have to sin, but there is a drive to sin within us. That drive was not in Jesus, who was and is intrinsically righteous.
Here’s a helpful, brief article. This is also a good resource from John Piper. Though he doesn’t deal with Adam and Eve’s first sin that they committed before they had a sin nature, his insights are nonetheless significant.