Airline passengers beware: when you buy a ticket, you are not only subjecting yourself to the ordeals of security queues, baggage limits and turbulence. You are also signing a near-40,000-word contract with a carrier that, in the extreme case of a United Airlines passenger on 9 April, could have you hauled off an overbooked aircraft – legally – as fellow customers and a global web audience look on aghast.

Sunday’s extraordinary scenes on a Chicago, Illinois, to Louisville, Kentucky, flight unfolded because of two regulations that are standard practice across the industry. The first says a passenger can be barred from a flight if the number of customers with tickets exceeds the number of seats. The second says the captain can have you removed from the plane if you get emotional about it.

Air travel is a thicket of regulations and acronyms that, of course, have your safety at heart. But there can be a thin line between guaranteeing your security and dragging a seemingly innocent passenger off an overbooked aircraft.

Flight overbooking is a phenomenon born of an industry that has struggled historically to make money. Indeed, airlines lost nearly $50bn (£40bn) in the past decade due to a combination of the 9/11 attacks, high oil prices and the credit crunch. The sector is making money now, but profits are slender – $9.89 per passenger per journey – so taking a risk and selling 183 tickets for a 180-seater plane is worth it if three of those passengers fail to turn up and you can pocket their fare expenditure as pure profit.

“Airlines have very large fixed costs, so if they don’t fill the plane past a certain point they will lose money. They know a certain proportion of these passengers will not show, so they need to overbook to get to break-even or better,” says Brian Pearce, the chief economist of the industry’s trade body, the International Air Transport Association.

The contract of carriage at United – the conditions to which you agree when you buy a ticket – comes in at 37,000 words and embraces a range of arcane treaties and rules, from the Montreal and Warsaw conventions to FARs, the US’s federal aviation regulations.

According to one legal expert, United was acting within its rights as the furore unfolded when it tried to find seats for four crew who needed to reach a plane they were due to operate in Louisville. But such a calamitous collision of passenger rights and airline prerogative is unlikely. “It is a very rare set of circumstances,” says Kevin Clarke, a flight-delay specialist at UK law firm Bott & Co. Pointing out that US airlines usually seek, and find, volunteers to come off full flights in exchange for compensation, he adds: “It can be a question of who backs down first.” In the case of this United flight, the passenger certainly didn’t.

United’s contract of carriage is a joyless tour of one of the world’s most over-regulated industries, where a minority of colourful terms – “acts of God”; “civil commotions” – is crowded out by tightly worded legalese that will stop you from taking any future journey for granted (at least on United). Under rule five, covering “cancellations of reservations”, the passenger is warned that all flights are “subject to overbooking”, which could result in the airline being unable to put the passenger on the flight. In that scenario – please bear with this – rule 25, on passengers denied boarding compensation, kicks in.

Using language that inadvertently acknowledges the confrontation inherent in the situation, it states that, if no passengers agree voluntarily to give up their seats in exchange for compensation, “other passengers may be denied boarding involuntarily”. Admittedly, there is recompense of about $1,000 available in this scenario, but it appears that the United passenger in this case said no. This brought him head to head with the far tougher rule, enshrined under the 1963 Tokyo Convention, that says the captain’s word is law on an airliner and that he or she has “the ultimate authority” in dealing with any onboard incident.

Rule 21 of United’s contract states that removal of a passenger may be necessary if their conduct is deemed to be “disorderly, offensive, abusive or violent”. It appears that the Louisville-bound passenger refused to give up his seat voluntarily and the crew deemed his behaviour to be out of line, prompting them to call in the security team at Chicago O’Hare international airport.

Compensation for delays caused by overbooking is guaranteed by EU law. Photograph: Justin Sullivan/Getty Images

Speaking to the Guardian on the condition of anonymity, a senior pilot at a major airline said: “The legal position is that you are not guaranteed to travel and that you must obey any ‘reasonable commands’ of the crew. So, legally, the airline is right.

“If it were me, I might have sought to promote a different solution [to allow] the crew to travel. I suspect a crew was ‘out of hours’ [about to exceed its working-hours limit] or sick or injured somewhere else on the network and the decision was therefore a little late to send them on that aircraft. I think the reputational damage from the events on Facebook will be significantly worse than a delay – even significant – elsewhere.”

Airline professionals are astonished that United’s overbooking procedures, in a market where overbooking is prevalent, resulted in a passenger being allowed to board before they were subsequently dragged off. John Strickland, an industry consultant whose career has included managing the overbooking process at a major airline, says carriers now have sophisticated computer systems that calibrate whether flights can get away with being overbooked – right down to the specific route, the time of day and whether demand will surge due to holidays or special events. However, he adds: “It is not a perfect science, which means when it goes wrong it needs to be handled sensitively.” This is where United, a so-called full-service airline that tries to offer a level of customer service superior to that of budget rivals, could suffer lasting reputational damage.

At the end of rule 25, United states: “UA shall not be liable for any punitive, consequential or special damages arising out of or in connection with UA’s failure to provide the passenger with confirmed reserved space.” Best of luck with that one, United.

An argument in favour of airline laws is what happens when they disappear. In the UK, compensation for delays caused by overbooking is covered by a regulation called EU 261/2004. According to industry lore, it came into fruition when MEPs grew exasperated with being bumped from flights to Brussels and Strasbourg. But airline passenger compensation could be one of the items of red tape that will be lobbed into the Brexit bonfire come EU independence day. One of the unintended consequences of severing links with Brussels, and abandoning EU 261/2004, is that passengers flying from the UK could be exposed when we say goodbye to the single market.

“There is the possibility that we adopt the principles of the regulation [after leaving the EU],” says Bott and Co’s Clarke. “But it is a possibility that we will be left without that protection. The obligation to put you on an alternative flight, the entitlement to compensation, that would not be there. You could be left stranded.”

Another reason for Michael Gove and his fellow Brexiters to stick to the staycation.