Every new arrival at Heathrow attracts attention. Simon Calder goes backstage to find out how

By the final stage of my tour of the innards of Heathrow Terminal 5, I wasn't entirely sure whether I was landside, airside or possibly even under arrest. I was inside one of the many rooms beneath Arrivals that the travelling public rarely sees. No windows nor cheer, just fluorescent light and grey paint.

Should you ever find yourself in the carpetless chamber marked SIR ("Special Investigation Room"), you are not going to be there for fun. SIR is the aesthetic opposite of the British Airways Arrivals Lounge for premium passengers. Either you will recently have touched down at Heathrow and be suspected of having swallowed packages of narcotics, or you will be a member of the UK Border Agency (UKBA) employed at the business end of keeping illegal drugs out of the country – watching and waiting for nature to take its course.

My guide to the innards of the British Airways terminal at Heathrow was Brodie Clark. He is head of the UK Border Force, in charge of 8,000 immigration and customs staff. They work, as you would imagine, across the nation from Dover Eastern Docks to Belfast International Airport. You may not know, though, that 800 men and women are deployed in northern France and Belgium to detect everything from people-smugglers to contraband tobacco.

"Our border has a long reach," says Mr Clark. He had agreed to show me the aspects of the immigrations and customs operation that passengers rarely see: a behind-the-scenes walk-through to shed some light on the parts of travel that most of us regard as a tedious necessity.

The two components of getting into Britain are, as you know, about the person and their possessions (including those carried inside the body). Traditionally, immigration officials have been the people checking passports, while customs staff inspect baggage. The two services were merged in 2009, in a bid to improve both efficacy and efficiency.

Law-abiding passengers want to get through the system as swiftly and painlessly as possible; taxpayers demand value and vigilance. Brodie Clark has the task of reconciling these conflicting wishes – and coping with the shifting moods of travellers. An outbound passenger is typically buoyant and tolerant, full of anticipation at the experiences ahead. Coming home, you just want to get the journey over with. But with Britain seen as an attractive destination by villains, from human-traffickers to terrorists, the authorities want to satisfy themselves that you are who you (and your travel document) claim to be.

Real strains on the system began three years ago. You may not even recall that the previous practice, whereby British passport holders were often waved through, came to an end. Today, every one of the 125 million people who arrives in the UK every year is scrutinised. The crucial identifiers of name, date of birth and passport number are checked against a database of people of interest to the authorities. Which explains the queues for passport control.

The agency's target is for 95 per cent of EU citizens to be through in 25 minutes or less; the same percentage of travellers from outside Europe can expect to take under 45 minutes. You can accelerate your progress using the IRIS recognition system, for which you must register at a UK airport when travelling outbound. It admits you through special gates in the blink of an eye. It appears to be only a transient travel benefit; the system was recently closed down at Gatwick's South Terminal.

The new fast track is the "ePassport gate". If you are one of the millions who has obtained a passport in the past five years, your travel document should come complete with electronic chip. This carries an analysis of your face geometry. Anyone over 18 can use one of the ePassport gates, which compare the measurements on the chip with an image captured by a camera at immigration. You can whizz right through. Yet few do. Of six-million plus who qualify to use ePassport gates, last year only 30 per cent did.

Amsterdam's Schiphol airport has long had a system for frequent flyers called Privium: "professional travellers" pay a subscription of around £100 in order to use fast-track channels. Heathrow hopes to deploy a similar system, based not on iris scans but on fingerprinting.

For the mass market, unseen improvements are already under way. There is a worldwide move towards Advance Passenger Information (API) before travellers are allowed aboard their plane. A pilot project, code-named SmartZones, analyses the data before the plane lands. It involves some short- and long-haul flights where a high proportion of passengers are British. On arrival, they have only a light-touch encounter with an officer who checks passport photographs – like the olden days. In tests, the time taken to process a European flight has fallen from 18 minutes to eight.

"We're focused on the passenger experience, and on safe ways to get people through the border," says Brodie Clark. "Our intention is to help low-threat people through quickly, safely and comfortably. Those who do intend harm are sifted out."

By accelerating the process for some travellers, such as those using ePassport gates, waiting times can be shortened and more of each officer's time can be devoted to detecting potential villains. Mr Clark took me to the Forgery Room (yes, I did ask: it's where they identify fakes, rather than manufacture them). Forgers use high-tech industrial processes to create fake passports that can be detected only with high-spec equipment, though Italian identity documents – barely more complicated than a college library card – are also favourites.

While immigration are busy people-watching, customs officials are, if you will forgive the phrase, working in the bowels of Terminal 5.

The entire £3.6bn building was constructed around its baggage system. An aircraft arrives; the luggage containers are taken out; transfer bags go in one direction, while the remainder are hauled to the arrivals area and placed on the conveyor belt.

Just before this happens, though, customs staff can take a look at a particular flight. They scan each bag in search of contraband such as cigarettes before it appears on the carousel. Passengers are unaware that this is taking place. So the smuggler retrieves the offending case, then heads for the green channel into the waiting arms of UK Border Agency officers.

Not every smuggler places their illegal haul in a bag. Many "mules" – people paid to import drugs – are carrying them inside their bodies, either as "stuffers" or "swallowers". Next time you pass through the system at Terminal 5, spare a thought for the officers staffing SIR, at the business end of customs work, peering at a glass U-bend. (If end -users were aware of where their cocaine had been, they might not consume it with such enthusiasm.)

Happily, I was not a suspect. I was escorted down a corridor and through a door where I could join the stream of new arrivals going landside. At the newsagent, a magazine showed George Harrison on the cover. The title of the late Beatle's first solo album seemed oddly appropriate: All Things Must Pass.

Are you being self-served? Gatwick's north-south divide

In the 20th century, flying was a pleasure and a privilege. But since terrorist attacks demonstrated the appetite among fanatics to use air travel as a means to commit mass murder, the airport experience has degraded to the point where cruise companies promote "no-fly" voyages. The travel world has been turned on its head, and aviation is now the opposite of glamorous.

But Stewart Wingate, boss of Britain's second airport, believes it doesn't have to be like that. If you're flyiing from Britain's second airport on Tuesday morning, expect a media scrum when Mr Wingate and the transport minister, Theresa Villiers, officially open the South Terminal's new security search area. But the system is already in operation – and this week I tested it, and compared it with the North.

The first surprise is "self-service" access. Instead of a queue snaking towards an officer who laboriously checks every traveller's boarding pass, you see a line of clear glass gates.

Your boarding pass – or, these days, smartphone – carries a two-dimensional barcode with your flight details. Wave it at the scanner and the gates open. If you are a domestic passenger, something else will happen without your noticing: tiny cameras on the gates will scan your iris. When you reach the gate, another device does the same. (A double-check is needed because domestic and international passengers mingle at Gatwick, and the identity of each traveller who turns up to fly to Manchester or Glasgow must be verified.)

Once through the gates, you can survey the 19 search channels and choose the one with the shortest queue – or, if time is on your side, the most friendly looking staff.

At any airport, the waiting time for security is one of the most stressful unknowns. Gatwick's new facility can process an average of one traveller every second, 25 per cent better than the previous performance. The target is for no passenger to wait more than five minutes.

Same morning, same airport, different terminal. For the past 23 years since North Terminal opened, it has housed BA's Gatwick operation – and is now also home to Emirates, Thomson Airways and some easyJet flights. Two days after South Terminal's launch, BA's chief executive, Keith Williams, will open the airline's "brand new home" at North Terminal. This has nothing to do with security, and indeed BA's home is merely improved rather than brand new. Following a massive refurbishment, the airline's check-in area is now more spacious and user-friendly.

The security search, though, offers the same old experience rooted in the 20th century. Staff check boarding passes individually, and domestic passengers must be photographed. The search area feels cramped and awkward compared with the open spaces of South Terminal.

Improving part of an airport makes the rest look poor in comparison, and in Tuesday's test, Gatwick's old-style North Terminal search area proved no worse than other UK airports.

The new South Terminal is proof that airport security need not be miserable, but has not been problem-free. The iris scanner has had a couple of hiccups; and in the Caribbean-like heatwave last weekend, the air conditioning performed below par.

It remains to be seen how the system will cope on contact with a Saturday in the Easter school holidays, when skiers collide with sunseekers. But I can now confirm that all the staff are equally friendly-looking.