Answer:
Because U.S. cryptographers were able to break down the Japanese code and found out that their naval fleet was preparing an attack on Midway.
Step-by-step explanation:
The battle of Midway is considered as a turning point in the Pacific stage of World War II. Japan was trying to give a second major hit after the attack on Pearl Harbour six months before.
But the Japanese army undermines the strength that the United States army had, especially the intelligence branch. The cryptographers broke down the Japanese code and, by deceives, found that Japan was planning to attack Midway and they could determine the date and amount of forces that Japan was preparing. The United States naval forces planned an ambush and could intercept Japanese forces and caused them several damages that they could not recover.
I hope this answer helps you.