If dive bombing a destroyer or cruiser during World War II, the hit rate was actually not as high as one might imagine.
Aircraft attacking ships in the WWII era was not an easy task, facing the dense anti-aircraft fire on the warships, it was generally difficult for aircraft to obtain a very good attack window.
The anti-aircraft guns on warships were not meant to shoot down aircraft but to force them to attack from less than ideal distances or angles, creating opportunities for the warships to evade torpedoes or bombs.
But without such dense and continuous anti-aircraft firepower, warships stood little chance against aircraft.
As long as there was an angle not covered by the barrage, aircraft could use it to make a close approach, creating damage and consequently causing the warship to lose more anti-aircraft gun positions, trapping the warship in a vicious cycle.