He had two dreams telling him to attack Athens and all of the Hellenes. That was after he had thought to do so anyway. His chief adviser told him not to do so. At night he saw a handsome man standing over him telling him if he does not attack Greece he would lose everything just as fast as he gained everything. Then he had a second dream along the same lines. And then his put his chief adviser in his royal robes, and sat him down on his throne at night to sleep. The same man came to his adviser and said "Are you the one who has been telling Xerxes not to attack Athens? You are jerk." Or something along those lines.[I forget the exact words.]
When he attacked his allies were numerous. Everyone thought he would win and joined him. No one joined the Hellenes. Even those that had agreed to ally themselves with Athens stayed away from the battle to see which side would prevail.
300 Spartans and about 4000 other men from other parts of Greece stopped about 1/2 a million men.
And the Spartans would have won if not for one betrayer who showed the Persians and alternative route to get behind the Greek lines.
Xerxes was the last great king of Persia and from then on its glory and might fell.