Because the air gets trapped inside when the ship first sinks and has no where to go.
That air pocket can’t just absorb through the metals walls out of the ship, and it can’t go down into the water then back up and out, gravity won’t let that happen.
So, it just stays trapped there unless there’s a hole or crack or soemthing to get through.
There’s air in the ship when it start sinking. As water levels rise, air gets pushed upwards. Some places on the ship, the air cannot escape the ship by going upwards. Unable to go upwards (there’s ship), and unable to go downwards (there’s water), the air stays trapped in the ship, even at the bottom of ocean. That’s the air pocket.
You get air pockets in cave system in a very similar way – water levels rise, air gets stuck.
Latest Answers