The story you always hear is that battleships were made obsolete by aircraft and carriers. I saw this argument develop on twitter phrased as "did an aircraft ever sink a battleship?"
I looked into it, but only a little. It seemed like a lot of battleships sunk by aircraft were, like the US battleships at Pearl Harbor; sunk while at their moorings. Or they were "sunk" at sea, but managed to perform successful damage control and were refloated without too much trouble.
Am I misunderstanding? A tiny amount of Wikipedia-ing makes me think that battleships, as a class; were too tough for aircraft of the time to be much of an existential threat. Are they obsolete because they are vulnerable, or because carriers and aircraft do their job of shore bombardment better, while also being faster and better at controlling the seas?
And if this isn't too far beyond a question of history: how much have the facts of life changed today? Would a massive, heavily armed ship lose to a carrier? I.E., without aircraft/drones; could a big, tough platform with lots of missiles/guns/torpedoes win? Or would it lose?
What if we got more science fictional, with functional railguns and lasers and ???
(*I am aware that ship sizes have changed a lot as well. For instance, a modern destroyer in 500-some feet, where the destroyers of WWII were under 400. If, based on length, the hypothetical battleship got a similar upgrade; I think it would be 1000+ feet. I realize length doesn't mean as much as displacement, length just works easier in my little brain.)
I ALSO realize that "effective in a fight" is different from "an efficient use of funding, manpower, resources." This may be a bad hypothetical.
Five capital ships were sunk at sea by aircraft during WWII (plus a sixth which had been heavily damaged in a surface action beforehand). The first pair were the British battleship Prince of Wales and battlecruiser Repulse, sunk by Japanese aircraft off the coast of Malaysia on the 10th December 1941. The Japanese battleship Hiei was sunk by aircraft off Guadalcanal on the 13th November 1942, following a night action where she had been heavily damaged by American cruisers and destroyers. On the 9th September 1943, a German aircraft sank the Italian battleship Roma with a guided bomb. The Japanese sisters Yamato and Musashi would be the final pair to be sunk; Musashi during the October 1944 Battle of Leyte Gulf, and Yamato en route to Okinawa in April 1945. Many more battleships were heavily damaged by aircraft at sea. Warspite, for example, was heavily damaged by a glide bomb off Salerno in September 1943; this damage was never fully repaired. While Bismarck was never in any danger of sinking from the torpedo hit from Ark Royal's Swordfish, the rudder damage it caused enabled British battleships to catch and sink her. Finally, it should be noted that, until aircraft were available, it was almost impossible to attack a fleet in port with battleships; submarines, mines, shore batteries and torpedo boats made it far too dangerous. Aircraft, which could be launched from outside the reach of fixed or short-ranged defensive tools like these, could easily attack a fleet in port. As such, sinkings of battleships in harbour are still emblematic of the vulnerability of battleships to aircraft.
Battleships were already somewhat vulnerable to aircraft at the start of WWII. The torpedoes carried by aircraft could be dropped at the limits of the ranges of their light AA weapons, reducing the risk to the aircraft. While the torpedo protection systems of modern battleships could effectively protect against the small warheads of these early torpedoes, hits to the less-protected bow and stern could do serious damage. Such hits sank Prince of Wales and crippled Bismarck. Over the course of the war, air-dropped torpedoes gained in speed, range and warhead size, making them much more dangerous. The thick decks of battleships could largely shrug off bombs dropped by early dive-bombers or level bombers. Later in the war, more effective armour piercing weapons were produced. Guided bombs like the German Fritz X could be dropped from outside the range of a battleship's AA weapons, and could easily pierce its deck. The guided rocket-propelled weapons in development later in the war, like the British Uncle Tom, could even penetrate a battleship's side armour. Finally, the introduction of the nuclear bomb completely negated any passive protection; no battleship could survive a nuclear explosion from short range. As more carriers became available, these effective weapons could be deployed en-masse, overwhelming the AA protection of a battlefleet and sinking them with impunity.
At the same time, carriers are also very vulnerable. Musashi was sunk by 17 bomb and 19 torpedo hits; at Midway, Akagi was rendered beyond repair by a single bomb hit. Carriers are, usually, poorly armoured, and contain large stocks of highly flammable aviation fuel, not to mention bombs, torpedoes and other munitions. Given this, why did they supersede battleships? The answer lies in their ability to do damage. The problem with battleships, for the most part, is that they are much less able to deliver their firepower than carriers are. Some hard numbers are useful here. The longest-ranged hit scored by a British battleship came during the Battle of Calabria, when Warspite scored a hit on Giulio Cesare at a range of ~26,000 yards. The longest-ranged engagement by a British warship came in 1918, when the monitor General Wolfe shelled a railway bridge near Ostend at a range of 36,000 yards. The longest range obtained with a British naval gun was 51,000 yards, using a 14in gun in a high angle coastal mount and super-charges that never saw sea service. The first British carrier torpedo bomber, the 1917 Sopwith Cuckoo, had a range of ~160 nautical miles, or ~325,000 yards. In other words, the earliest aircraft carrier could deliver firepower to about six times the range as the best possible battleship. With improved aircraft designs, this ratio only goes up - and those aircraft can carry much more firepower too. An aircraft carrier is much more effective at fighting as a result; it can engage targets in a much greater radius and, as a result, damage or sink a battleship before it can get into rage to do the same to the carrier.
Given that battleships were as vulnerable as carriers were, and worse than carriers at doing damage, there was little reason to use them. They had large crew requirements, making them expensive to run day-to-day. They were very complex to build; the turrets in particular were some of the most complex pieces of machinery ever to go to sea. This made them expensive to build too. Carriers are much simpler to build, and while they do still have large crew requirements, carriers are more capable and flexible than battleships. A battleship is only really useful for shooting big guns at things nearby; carriers can strike targets ashore and at sea, provide fleet air defence, provide radar and ECM support and carry out anti-submarine warfare.
The advantage aircraft had over battleships was mobility. Whereas a battleship could patrol at anywhere from 20 to 30 knots depending on the class, aircraft cruised at several hundred miles per hour and thus could cover vast distances in far shorter times compared to surface ships. Just as importantly, they flew at high altitudes, meaning they could spot targets much further away than any surface ship could. For aircraft carriers, that meant that they would be far more likely to spot a battleship before it ever closed to gun range and would be able to hit it with airstrikes long before the battleship would be able to close to gun range.
Now let's look at a few case studies. You've noted that battleship losses to aircraft are comparatively few, but that's in large part because commanders learned fast once the vulnerability was made clear, so they did their best to keep these massively expensive assets out of harm's way.
Let's start with Pearl Harbor. During the attack, all eight battleships in the harbor were hit, four of which sunk (Arizona, Oklahoma, West Virginia, and California). Arizona was the most complete loss - its keel was broken by the attack. Oklahoma capsized, and the damage was extensive enough to deem it a complete loss as well. The other two ships were salvaged and returned to service after extensive rebuilds, but only thanks to the shallow harbor, which meant that the ships would be relatively easily recovered even after sinking. Had the attack occurred at sea, it would have been a far different story, and West Virginia and California would have been lost. A key thing to gather from Pearl Harbor was that air defenses were not enough to prevent aircraft from hitting ships. Far more aircraft could be thrown at ships than the ships could counter with their antiaircraft guns, and it only took a handful of bomb and torpedo hits to sink battleships.
Next, there's the sinking of Prince of Wales and Repulse. 88 land-based aircraft - primarily Mitsubishi G3M and G4Ms - descended down on a battleship, battlecruiser and their four escorting destroyers. In the absence of friendly air cover, the British ships were helpless as the Japanese bombers were free to execute attacks on the ships. They ultimately sunk both capital ships, losing only four aircraft for their trouble. This more than anything likely sealed the fate of the battleship - they had proven that they were all but helpless in the face of coordinated air attack.
Looking back to Europe, we have a handful of examples that are relevant as well. The Sinking of the Bismarck, although largely a surface action, saw the capital ship crippled by torpedo attacks from Fairey Swordfishes - an obsolete biplane. Even if other ships hadn't come along to finish the job, the aircraft had done enough damage to force the ship to abandon its mission and return home, and in many cases, a "mission kill" like this often has a similar practical effect as sinking a battleship does.
Again in Europe, there's the attack on the surrendering Italian fleet by the Germans in 1942. Attacks were made with guided bombs, striking the battleships Italia and Roma. Italia suffered a single hit forward of the turrets causing major damage; Roma suffered two hits that broke its keel and detonated its magazine, destroying the ship. In a different action, Warspite was hit with a single bomb that caused major flooding and killed the ship's engines, forcing it to be towed back to Malta for repairs. Here, we see the damage a single well-placed hit can do, even to the most well-protected ships of the time.
Now let's get back to the end of the war in the Pacific. The two *Yamato-*class battleships, Yamato and Musashi, were both sunk by air attack. Musashi was first at Leyte Gulf. To her credit, the ship soaked up quite a few hits from both bombs and torpedoes before succumbing to the damage, but even so, the ship proved incapable of weathering air attack. Yamato would be refitted later in 1944 with a significant upgrade to its antiaircraft guns, but to little effect - it was sunk during operation Ten-Go, again purely by aircraft. For the cost of just ten aircraft, the largest battleship in the world was sunk after suffering 11 torpedo and 6 bomb hits.
So looking at these case studies, we can see that, while durable, battleships were still incredibly vulnerable to air attack and practically helpless when attacked without friendly air cover. They rarely were in a position to fire upon enemy surface ships when these attacks came, and only once - at the Battle off Samar - did battleships manage to engage carriers in a surface action. Meanwhile, well-designed carriers were proving to be similarly durable to battleships (just look at how much damage Enterprise or Yorktown weathered), all while having significantly more effective weapons - their aircraft.
It's important here to understand some potentially fine distinctions. Abstract survivability or its inverse of vulnerability is one thing, as are effectiveness in a fight and efficient use of funding and resources (including crew). However, these are just rungs on a ladder toward the more important goals of being able to gain initiative and, ideally, direct the outcome of battles, which themselves are also rungs on the ladder toward large scale strategic goals.
WWII-era battleships were so expensive that they had to not just be survivable and effective, they had to be utterly dominant in order to be worth the effort. Iowa-class battleships were significantly more expensive than even Essex-class carriers, for example, so they had to be worth it. However, experience showed that they were not, which is why they were considered obsolete by the end of WWII. The presence or absence of a fleet carrier in a WWII naval battle could easily completely alter the outcome, nature, and even the stakes of that battle. That was certainly the case throughout the Pacific War, where the major naval engagements were those where fleet carriers tangled with one another (or in the case of the Battle of Okinawa where US fleet carriers supported a ground invasion vs. a Japanese Navy that had been largely depleted of its air arm and carriers through attrition). Very rarely was the singular presence of a battleship a deciding factor in WWII naval engagements, and in many cases battleships ended up in primarily defense postures throughout the war.
The imagined role for battleships prior to WWII was that they would chew through enemy naval forces at great range while engaging in slugging matches with opposing battleships until whoever had the advantage of firepower, armor, or luck won the day. You could think of battleships as vessels designed to achieve "sea superiority" the way "air superiority" would become important later. With "sea superiority" your naval forces could interdict enemy commerce and logistical shipping with impunity, and would themselves be advantaged in being able to operate its own commerce and logistical transport unmolested. Largely this fantasy never materialized (with only a few engagements resembling it during the entire war), due to a variety of innovations the most important of which was certainly the airplane and aircraft carriers. Even with radar a battleship does not have the range of visibility that naval aviation provides. Even with the largest guns and the most sophisticated fire control systems a battleship could only engage at ranges of up to 40km, barely over a tenth of the range of the aircraft of a carrier. A battleship could not hope to dictate the terms of engagement to a fleet carrier, and it had no chance of forcing an outcome in a battle, the best it could do was hope for survival, a hope that was all too often just as unrealistic as the sea superiority fantasies of earlier eras.
WWII made these things abundantly clear, and battleships were largely re-purposed for other roles: aircraft defense and shore bombardment (or protection). These roles were in no way sufficient to justify their vast expense, but in making use of resources having already been spent they were mostly worthwhile (at least through WWII, afterward it became much less tenable). It's noteworthy that every battleship that made it into service in the US, UK, Japanese, and German fleets was laid down before the battle of Pearl Harbor, and many plans for additional battleships were curtailed when it became clear they were not the world-beaters they were originally imagined to be.
Additionally, I would argue that the question of whether a more modernized battleship would win or lose to a carrier is wrongly framed. The question should not be whether or not a battleship could win or lose vs. a modern carrier, but whether it would do so because it was a battleship and not something else. And there I think the answer is pretty clear-cut, nothing about a large, heavily armored vessel makes it particularly advantageous in modern naval combat. The most devastating conventional attack another naval vessel could visit on a modern aircraft carrier (aside from a sortie of aircraft, of course) would be a barrage of guided missiles, particularly ballistic missiles, precisely the same thing that would imperil a modern battleship as well. However, there is nothing about the battleship that makes it uniquely capable of firing such weapons. If you can pack a much smaller and lightly armored vessel with the same sort of armament plus provide it with the CIWS, SAMs, ABM systems and so forth that provide a more effective counter to anti-shipping weapons at a fraction of the cost then you're going to pick that platform instead. In terms of strict survivability vs. a carrier you might even go so far as to look at a submarine missile platform to fulfil that role instead.
Similarly, while railguns or drones might increase the effectiveness of a battleship they wouldn't increase the necessity of a heavily armored vessel. In the modern era active counter-measures, distance, speed, and stealth (as in the case of submarines) dictate survivability, not armor thickness.
It is true that modern anti-shipping weapons (such as cruise missiles) would not be particularly effective against heavily armored ships such as WWII-era battleships. However, this isn't a technological hurdle, it's just a matter of optimization. If someone began operating heavily armored battleships it would be a simple matter to introduce more devastating anti-shipping weaponry to counteract the threat, effectively re-obsoleting such vessels in short order. Everyone understands this would be the response of any attempt to introduce a new large battleship into service, so nobody bothers actually doing it. It's likely that same calculus will remain in force through the foreseeable future.
Thank you everyone for your very interesting replies!