They are built to be airtight so thsy sir can't get in or out, and then, as they climb up to where the air is thin, they use an air pump to pimp air into the inside.
Just like a party balloon.
Airplanes are artificially pressurized through a system that compresses outside air, cools it, and distributes it throughout the cabin. This process maintains a comfortable and safe pressure for passengers at high altitudes where outside air pressure is low. The pressurization system includes safety features to ensure consistent cabin pressure.
;