The traditional teaching is that Satan knew Jesus was the Davidic king, a prophet, etc., but was unaware that Jesus was God.
You can see this by what Satan offers Jesus. None of it is anything that Jesus didn’t already have; and in fact, it’s pretty funny what Satan picks as being exactly what Jesus already had.
Make stones into bread? When Jesus is the Bread of Life, the Bread come down from Heaven?
See if the angels would come? Sure, that’s maybe a test for a Davidic Messiah, but not for the Master of all good angels, and Creator of all the angels!
And of course, the big one – take dominion of the world from Satan, when You are already Creator and King of the universe? Hahahaha!
Jesus actually treats Satan with a lot of courtesy by “staying in character” as a pious human. Of course, this demonstrates that human intellect and free will is capable of dealing with the Devil, if we didn’t have a fallen nature to deal with.
So it’s a great rematch of humanity against the Devil. Just like Eve presumably didn’t know the whole story behind the Devil, this time the Devil doesn’t understand that he’s talking to a man Who is also his old Boss.
This time, the human has an answer to everything. This time, we win.