The Battle of Midway pitted US Task Forces 16 (USS Enterprise and USS Hornet) and 17 (USS Yorktown) against the IJN's Striking Force, (Akagi, Hiryu, Kaga, and Soryu).
USN carriers started with converted collier USS Langley (CV-1, ex-Jupiter). Langley was experimental, and by WW2 had been converted to a seaplane tender and aircraft transport. The next two USN carriers were USS Lexington and Saratoga (CV-2 and CV-3). These were converted mid-construction from battle cruiser to carriers. While suitable for use as carriers in the Pacific, they suffered a bit from their lineage and being very early in the development of carrier operations. They were long, with great displacement, not very maneuverable, and for their size their air group was not very large. Their air groups were similar to the later Yorktown class, but their fuel consumption greater and they were much larger targets. Lex was sunk at Coral Sea, while Sara survived the war, though relegated to training duty late in the war.
USS Ranger (CV-4) was the USN's first purpose-built carrier. Using later USN carriers as a base for comparison, Ranger was pretty much an attempt to create a fully capable fleet carrier in a light carrier hull. Because her construction was not the most robust and left little room and stability for upgrade, Ranger was not used in the Pacific, and was mostly used for aircraft transport. Then came the Yorktown class, USS Yorktown (CV-5), USS Enterprise (CV-6), and USS Hornet (CV-8). ~35% larger than Ranger, they were almost "just right" to Ranger's "too light". These combined a lot of lessons learned from earlier carriers and were very capable. Of the three, only Enterprise survived WW2; CV-7 was USS Wasp, which was not in the Pacific during the Battle of Midway.
Saratoga had been repaired from a torpedo hit, but did not make it to the Midway area in time to participate in the battle. Yorktown had been damaged at Coral Sea, but was sufficiently repaired to participate. Though two task forces, all three USN carriers were of the same class and capability.
On the Japanese side, IJN carrier development began with Hosho, which started life as a seaplane carrier and then converted to a regular carrier. By the time of Midway, her size made her unable to carry and operate modern planes. The IJN's next two carriers were Akagi, converted during construction to be a battle cruiser, and Kaga, originally begun as a battleship. Because of their different origins, they were somewhat dissimilar, Kaga being the slower. Japan's first from-scratch purpose-built carriers were Soryu and Hiryu, sister ships, but not identical. These were kind of in between light carriers and full-sized carriers, in size, air group, and robustness. The IJN's last two pre-war carriers were Shokaku and Zuikaku, basically the IJN's "just right".
These six IJN carriers combined for the Pearl Harbor attack, and then split up for other duties. Shokaku and Zuikaku fought at Coral Sea. Shokaku was seriously damaged, while Zuikaku's air group was significantly depleted. Hypothetically, Sho's and Zui's airgroups could have been combined to allow Zui to go to Midway, but the IJN did not operate their air groups that flexibly. Consequently, neither of the IJN's newest and best full-sized carriers were at Midway. Kaga and Akagi lacked the most advanced damage control design. IJN practice also placed the trained damage control specialists in the hangar decks, which were enclosed. That meant that both the fire control mains could be disabled by a single hit, and their damage control parties could be wiped out due to the enclosed hangar confining the blast of bomb hits within the hangar. Another aspect of IJN operations that increased vulnerability is that the process of fueling strikes and arming torpedo planes happened in the hangar deck.
Kaga took multiple hits, though due to her robust hull construction she became a floating inferno. Akagi took only one hit, but a second bomb was a very near miss at the stern, which took out Akagi's steering. Because her fire main and damage control parties were taken out, Akagi basically lost a protracted fight against her fires. Both (as well as Soryu, hit at the same time) had their strikes gassed and armed (except for dive bombers, which were armed when on the flight deck) in the hangar deck (all four IJN carriers were busily landing, replenishing, and launching their CAP, which could not be done with a strike spotted on the flight deck). Most USN bomb hits exploded in the hangars, which meant that the strike planes now provided several thousand gallons of fuel, plus torpedoes and bombs that would bake off.