The secret...
Making sure there are at least as many good guys armed as bad guys. Goes for a lot of places besides airplanes.
In the alternative universe SF book "Probability Broach," people were routinely allowed to carry their guns onto an aircraft, but were required to change out their ammo for special frangible clips that wouldn't hurt the plane.
