With England battling for its survival and barely hanging on to key bases in the Mediterranean and N. Africa, Japan saw a onetime opportunity to strike in the South Pacific, overrun British and U.S. possessions there, and expand their empire in order to have access to the raw materials they otherwise had to import. Their calculation was that taking out the fleet in Pearl Harbor would set us back years and by that time, they would have consolidated the South Pacific.
They knew that the U.S. was going to make them pay eventually but they were not expecting us to be able to fight back so quickly. They figured we would get dragged into the European war and be mired over there for years. Long term, they expected the U.S., wary of fighting yet another war, to eventually accept the new situation (in the South Pacific), after perhaps "winning back" some token possessions like Hawaii and the Aleutians.
The battles of Coral Sea and Midway (mid 1942) stunned the Japanese and it was then that they realized they made a grave error. But by then, it was too late.
Battle of Midway was devastating to the Japanese. Four of their best carriers sunk. They would never recover even though it did take three more years for us to finish the job.
If you war games it, Japan wins huge in the beginning. Japan spent too many resources taking things that didn’t matter. Everything should have been immediately aimed at Midway and Hawaii. If you take those, everything else comes in due time. All you need is the oil.
But eventually you lose because the Americans have almost infinite resources to throw at you.
They lost their highly trained experienced naval air arm at Midway. They then had to move their training cadres into the fleet as replacements. When they were gone, they were stuck with naval aviators who could barely fly, take off & land was about it.
Yes it was a BIG mistake. The USA handled them while maintaining the Europe first strategy and still almost wiped them off the planet