Two reasons. The ship building industry had already been mobilized at this point, and several fast attack carriers were on the way. Also, if you look at the roster of ships lost or seriously damaged they are battleships, which could no longer project enough force to dominate sea lanes in the aviation age, and not just that they were older, slower, ships. Nevada Pennsylvania Maryland and Tennessee were damaged but all were back in service before the end of 1942. The worst damaged ships were Arizona Oklahoma West Virginia and California. West Virginia and California were raised and rebuilt, back in service by 1944, only Oklahoma and Arizona were permanent losses.
Of the four worst damaged ships, Arizona Oklahoma and West Virginia were all built during the First World War. By Pearl Harbor they were all over 25 years old, slow, lightly armored and armed compared to modern battleships. California was built in the early 20's, still very old and slow but better armed than the others. The Japanese attack on Pearl Harbor basically knocked off a bunch of ships that were only in service because with war coming scrapping the oldest ships in the fleet wasn't an option.
By the time the Pearl Harbor attack happened the US had already ordered the first 12 fast attack carriers of the USS Essex class, and the first 10 keels had been laid. The first 3 of the class were launched in 1942, 5 more were launched in 43. They were the largest, fastest most capable aircraft carriers in the world and the Japanese were badly outnumbered for most of the war.