That is what makes submarines very dangerous when combined with an airforce.
Let’s say you attack a 3 fully loaded carriers with 6 fighters, you have 6 subs and 2 bombers.
Results will be that your 2 bombers might as well not have been used since you end up losing them versus fighters which can’t shoot subs. So obviously, you go only with subs and have a field day.
If the ennemy has a destroyer escort to counter your subs, he actually still shoot himself in the foot. The reason is that he actually give you the option to select subs as casualties from his fighters, enabling them to shield your air force.
In short, in lowluck ( I hate it but everyone plays that ), you will lose 5 subs first round and take out 2 carriers, 1 destroyer, +1.3 added casualty ( 1 fighter ). You then retreat planes and keep up on the remaining carrier with last sub that can’t be shot from planes anymore. IF he elected for 3 CV losses, your job is done and you withdraw bombers.
For a German player, the only thing you need to strafe the ally fleet is your starting fighters and enough subs to soak up the first round of casualties + 1 sub remaining so you can retreat planes. Italy could do it to a lesser extent.
I’m pointing this out because an opponent of mine insisted that his planes was not shooting my subs but my planes instead, yet he did have a destroyer which actually played against him overall.