At the very true core and this is a bit controversial.
It was unlucky placement and grand paranoia. The Japanese wanted to continue in the Pacific but pearl harbour was too close. They got worried that America was gonna join regardless and decided that now was the time to act.
Perhaps if the harbour was a little further away or the Japanese weren’t so paranoid they’d may of went through the Pacific and not attacked America. But this would still mean that we the ANZACs would be under threat.