The arrangement of the battle was skill. The victory had substantial portions of luck, in it.
If nothing else, at the climactic moment of the battle, the Japanese covering aircraft had just finished destroying the the torpedo bomber assaults. The entire CAP was on the deck when the U.S. dive bombers found a break in the cloud cover and fell on the Japanese carriers. As fast a the A6M Zero was, it still took 7 minutes to climb to 20,000 feet. The dive bombers had no fighter opposition while they lined up their runs.
Additional points of luck:
One Japanese scout plane found the Yorktown long before the actual battle, but radio problems prevented it from notifying the Japanese fleet of the Yorktown’s position.
The torpedo bombers were supposed to hit the Japanese in a coordinated attack, but the groups got separated and the torpedo bombers showed up early. Had the attack gone as scheduled, the Japanese CAP would have had to divide between defending against high- and low-level attacks, but neither the U.S. torpedoes nor the planes carrying them were that reliable, so the CAP would probably have concentrated on the dive bombers, reducing our ability to crush three carriers in a single blow.
The dive bombers that hit the Japanese were within a few minutes of exceeding their loiter time as they ran out of fuel. Their directions had been imperfect and they spent most of their time flying over heavy clouds with no Japanese below them. The discovery of the Japanese fleet occurred after the initial decision to turn back.
Naguno kept vacillating between attacks on Midway or attacks on the U.S. carriers and he had ordered the bombs changed (high explosive for land attack, armor piercing to attack ships) more than once, and in their haste to carry out the successive changes, the unloaded bombs were stacked on the deck instead of being returned to the magazine. It was the presence of so much live ammunition on the decks of the Japanese carriers that caused our fairly small number of bomb strikes to doom them. (You can chalk this up to bad command for Nagumo, but we still got lucky that he gave the specific orders he did.)
When the Yorktown was struck, a followup reconnaissance by the Japanese identified it as a separate ship, so instead of continuing to search for the Enterprise and Hornet, the Japanese attacked the Yorktown again, leaving the other two carriers to launch a final, fatal blow against the last Japanese carrier.
The U.S. forces fought Midway with intelligence, vigor, and incredible bravery (read some of the accounts of the torpedo attacks, especially in Martin Caidin’s (out of print) Rugged, Ragged Warriors. However, the overwhelming nature of the victory owed very much to luck.