Two things, their aircraft lacked armor protection and we also broke the IJN code( their “enigma”). Midway was a miracle we should gave lost that battle according to all the computer simulations of the battle.
Other way around. Japanese wargaming of the operation showed the catastrophe that actually occurred.
Their referees just 'raised' the sunk carriers so they could conduct the invasion of the island.
Japanese were outnumbered in aircraft.
Worse, their ships had no radar and a terrible radio in the Zero that rarely worked so it was difficult to coordinate air defense.
Eventually an airstrike was going to get through and cause catastrophic damage.