...
WWII battleships were very vulnerable to torpedo bombers and more so than certain other ship classes, despite the use of torpedo belts and heavier total AA armament. No realistic amount of AA on a ship at the time prevented carrier-launched torpedo bombers from getting within dropping distance against said ship. Protecting a BB was done by disrupting bombers before reaching dropping distance, either with air cover or layering AA with smaller ships like DDs spread around the BB.
...
This was true at the beginning of the war: the sinking of the Prince of Wales and Repulse was a shocking demonstration of air power, though it was later learned that most of the ships' anti-air capabilities were actually offline during the attack due to problems from condensation shorting out the radar and fire directors. Still, combined bomber and torpedo (and it was important for it to be a combined strike, as the two weapons were evaded in different ways) had been proven to be able to kill battleships.
A brief analysis: the battleships were ambushed without their early warning radar alerting them because of problems. They had no effective anti-air fire control, no proximity fuses, no air cover, and the air wing that attacked them was equivalent of the bombers force of 2 full fleet carriers. In these conditions, 8 of 49 torpedoes hit, with the Repulse dodging the first 19 fired at it. Once the ships lost their maneuverability and the aircraft deployed combined dive bomb/torpedo pincer attacks the hit rate went way up.
However there were two technological advances during the war from the allies that changed things: much better secondary battery fire control radar, and radar proximity fuses. With these, the 5' (125mm) 38cal secondaries were capable of very long range accurate fire that could splash incoming fighter and bombers squadrons. Also, over the course of the war ineffective smaller weapons were swapped out for 20mm oerlikans and 40mm boeffers (spelling on both, sorry), which were miles better than machine guns for AA. It did help that ships traveled in packs and those were the same guns used on destroyers and anti-aircraft cruisers (atlantas), but the preferred anti-air escort for the fleet carriers were battleships for the sheer number of AA guns, toughness, and operational endurance.
Japanese AA was, frankly, awful. It had little to no radar guidance, was undersized (often 25mm), and poorly mounted. But, in the Battle of the Sibuyan Sea (part of the battle of leyte gulf), the japanese battle line without air cover was attacked by 5 full fleet carriers and an escort carrier over 259 sorties. They managed to sink a super battleship and a cruiser, but were ineffective in actually stopping the force. The only reason that its not commonly remembered that mass air strikes were unable to stop a battleship force from powering through and slaughtering tens of thousands of people in transports is because of the ridiculous miracle (from the allied perspective) that was the Battle off Samar. (Where the equivalent of a couple of lashers with some condors with talons fought off an entire hegemony extermination fleet and 'won'.)
(Side note: German ship based anti-air radar was also somewhere between non-existent and awful, so while they had decent guns, they had nothing to point them, and they also didn't have radar proximity shells. Much hay is made of the Swordfish attack that crippled the Bismark, but its important to remember that visibility was bad and the Bismarck was using optical systems, there were no proximity fuses (and the wrong type of fuses to begin with), and the hit that jammed the rudder was very lucky. If the same kind of torpedo attack had been launched against a 1945 american battleship there would have been no attacking planes to survive.)
By the end of WWII, torpedo bombers were considered by the allies to be very high risk against a modern force: while they hadn't been on the receiving end themselves, american and british navies had observed first hand that new AA technologies made low and slow torpedo attacks suicidal. Even if the pilots could drop their torpedoes, they were likely to get hit on the way out. There was a lot of experimentation with high speed high altitude next generation torpedoes that could be dropped from level flight bombers outside of AA height, but that whole branch of technology became obsolete with the advent of jet fighters and guided missiles.
Wow that turned into a long post. For a run down of various wwII AA guns, see:
https://www.youtube.com/watch?v=HZqMqhUnVMUThe channel (Drachinifel) is a fantastic source of knowledge about ships of all periods with at this point several hundred hours of content.