On my 18th birthday, the marketing department of the Gillette Company sent me a surprise gift: a SensorExcel razor. Back then, in the mesozoic era of razor blade development (circa 1995), the SensorExcel was the latest in state-of-the-art swizziness, with its five "soft, flexible microfins" which stretched the skin and caused the beard hairs to perk up like so many unwary soldiers poking their heads over the parapet, all the easier to be mown down by the two spring-mounted blades following fast behind. These days, the SensorExcel is a quaint museum piece, having been superseded by razors with first three, then four and now five blades, not to mention all the other add-ons: lubricating strips, pivoting heads, low-friction blade coatings, battery-powered vibrations, trimmers and even microchips.

The three-bladed Gillette Mach3 was introduced in 1998; Wilkinson Sword (Schick in the US) upped the ante with the four-bladed Quattro in 2003. In February 2004, the satirical online newspaper the Onion ran a spoof article, supposedly by the CEO of Gillette, under the headline Fuck Everything, We're Doing Five Blades. Sure enough, a couple of years later, they did: the Fusion. The Economist, a magazine not normally inclined to scoff at those cornerstones of market capitalism, innovation and growth, took a leaf out of the Onion's book and ran a semi-humorous article suggesting that, if current trends continue, "blade hyperdrive will be reached in the next few years". A pseudoscientific graph showed the number of blades shooting hyperbolically off the chart before 2020.

But just what is it about adding blades that makes a razor better? And is it simply a question of adding blades? If so, how hard can it be? Do the companies already have six-, seven-, eight-, nine- and 10-bladed razors ready and waiting to be rolled off the production line whenever they feel they're slipping behind in the arms race? Shaving is serious business: in the UK alone, men spend more than a quarter of a billion pounds a year on razors and blades. That market is dominated by Gillette, which claims a 79.8% value share. That's 79.8% of the money, rather than of the number of razors: one reason for the disparity is that Fusion blades cost twice as much as Quattro refills.

Neither Gillette nor Wilkinson Sword would reveal the size of their annual research and development budget. But in 2005, Peter Hoffman, then the president of Gillette's blades and razors division, told BusinessWeek that the development of the Fusion cost slightly less than the $680m they'd spent on creating the Mach3 a decade earlier. Whether this is a lot more than, a lot less than or about the same as Procter & Gamble spend on developing a new line of Always sanitary towels or Olay face creams is a secret they're keeping to themselves.

The company was founded by the American entrepreneur King Camp Gillette in 1901 to mass-produce the disposable-blade safety razors he'd invented, for which he obtained a patent in 1904. Gillette is often credited as the inventor of the safety razor, though it had actually been around in various forms since the mid-19th century. His real innovation was the "razor and blades business model", also less politely known as "freebie marketing": give away the durable handles, flog the disposable blades (or "cartridges", as the modern multibladed razor heads are called in the trade). The company still relies on the model, as evidenced by my 18th birthday present. It's highly effective, and seems almost insultingly simple. The catch is that it also depends on technical innovation: freebie marketing wouldn't have worked for King Gillette if he hadn't come up with an affordable way to manufacture the blades.

Since the days of its founder, Gillette's headquarters have been in Boston, Massachusetts. In 2005, the company was bought for $57bn by Procter & Gamble, the consumer goods behemoth based in Cincinnati, Ohio. (Wilkinson Sword gets passed around a bit, too: in 2003, the pharmaceutical giant Pfizer sold it to the battery manufacturer Energizer Holdings.) The Gillette Technology Centre, however, is tucked away on an industrial estate between the A33 and the Old Basingstoke Road in Reading, Berkshire. It's an overcast morning in late summer when I pull into the visitors' car park, opposite the dozen or so spaces reserved for "shave test panellists", for a tour.

"I'm going to challenge you as you walk around," says the friendly, enthusiastic and clean-shaven lab director, Kevin Powell, "to find the group that is actually tasked with adding blades." He laughs. "That's the first question I normally get when I go to a cocktail party. Ho ho ho. Did you add some more blades today?" He shows me a patent from the 30s for an unwieldy, five-bladed razor that looks as if it wouldn't have been out of place in a medieval torture chamber. "It must have been excruciatingly uncomfortable," he says. "Just adding blades most certainly doesn't do it." He prefers to talk about the shaving "surface", a term Gillette trademarked, though it's hard not to see that as a semantic dodge to flummox the cocktail-party piss-takers. The surface does, after all, consist of a (growing) number of blades.

Anne Stewart, the centre's director for science, explains the thinking behind multiblade razors. It's all down to "a phenomenon we refer to as hysteresis". According to the Chambers Dictionary, hysteresis is "the retardation or lagging of an effect behind the cause of the effect", or "the influence of earlier treatment of a body on its subsequent reaction". In shaving terms, this means that when a razor blade encounters a hair, it doesn't only cut through it, it also pulls it a little way out of its follicle. So if there's another blade following close behind, it will slice into the hair lower down the shaft, before it has had time to retract into the follicle. "You've actually shaved below the skin level," Stewart says. "Can you ever get a closer shave with a single-edge cut-throat razor? In a stroke, no." Wilkinson Sword agree that the benefit of several blades is "closeness - in the case of Quattro with no compromise on safety".

In the high-speed filming lab, I watch magnified, slow-motion footage of a five-bladed Fusion cartridge sliding down a few millimetres of anonymous cheek. The first blade strikes a hair, slices into it, tugs it out; the second blade hits, slices again, drags the hair out even farther; the third blade strikes, then the fourth, then the fifth, each nicking off a chunk of the hair, though a smaller fraction each time. Adding blades, then, does lead to a closer shave, if with diminishing returns. But it's not simply a question of how many blades you have in your cartridge.

"The spacing between the blades is critically important," Stewart says. Too close together and you could get two blades in the hair at the same time, which would apply too much force to the hair and be painful. There also wouldn't be enough room between the blades for the debris to be rinsed through and the cartridge would get clogged. Too far apart and the hair will have retracted into the follicle before the second blade gets its chance to bite. There's also the danger that the skin will fold into too big a bulge between the blades: "And that causes skin discomfort and irritation as you come through." Finally, the larger the surface, the greater the drag, which again leads to discomfort. So the challenge was to fit five sharp enough, strong enough blades, with enough space between them, into a small enough area, to give a noticeably closer, more comfortable shave. "In terms of pushing the technology," Stewart says, "being able to weld the blades on the small blade supports was a real key enabler."

The prototypical five-bladed surface - codename: Surf - was "tested on literally thousands of men," Powell says. "Did that surface wow them? Unequivocally, yes."

There's more to the Fusion, however, than the five-bladed shaving surfaceTM. On the back of the cartridge there's a sixth blade, a single "precision trimmer", for doing trickier areas, such as under the nose, and to get nice, straight edges on your sideburns or goatee. The Wilkinson Sword Quattro Titanium, a jazzed-up version of the Quattro introduced last year, in part, no doubt, as a response to Gillette's Fusion, has an edging blade on the back, too. With the Mach3, "there was a very low level consumer complaint", Stewart says, "with a high level of frustration, about being able to trim." This is the downside of adding blades and creating surfaces: it's hard to cut a straight line with a plane rather than an edge. And once they've experienced the simple joys of an unpivoted single blade - ironically enough, the same principle as the cheapest kind of disposable razor - there's no going back for Gillette's guinea pigs. When making a prototype, Powell says, "sometimes it's easier for us to try to do it without putting a trimmer on the back. It's a revolt. They go: 'I can't do that!' "

"They" are the shave test panellists, the 80 men who go to the technology centre five mornings a week, 50 weeks a year, to have their daily shave with one of Gillette's experimental prototypes. The "consumer testing facility" is in a separate building from the research and development labs. As we walk from one to the other, Powell says, "We are very much on lockdown because, let's face it, there's a huge amount of commercial potential locked up in there." He pointed back at the main building. "But a lot of these ideas, although clearly we prosecute for patents - you know, we apply for patents - but nonetheless a lot of those things haven't even started yet. So there's a complete lockdown." The Fusion system has more than 70 patents registered on it; the Wilkinson Sword Quattro range has more than 100.

The consumer testing facility smells strongly of shaving foam. When the panellists arrive, they have to check in - there's a "pin verification system" to exclude interlopers - then each is given his "shave box" with the day's razor in it and a barcode that has to be scanned, to make sure everyone gets the right box. "The one thing you want absolutely to ensure is there's never an opportunity for somebody to shave somebody else's razor, from a cross-contamination point of view." (Powell talks about "shaving a razor", rather than "shaving with a razor", so that, grammatically speaking, the direct object of the verb is the razor, not the face. Though it probably wouldn't be fair to read too much into the idiom.) The panellists are closely observed as they shave and afterwards fill out questionnaires. I ask if they're paid. "Yes, they are," Stewart says. "Incentivised," interjects Jennie Larby, who's in charge of the facility. They don't tell me the size of the incentives.

One of the panellists has volunteered to give a shaving demonstration. I watch him through a two-way mirror, video cameras trained on him over my shoulders. It's a strange, unsettling experience to look into a mirror and see another man shaving. He leans in close, turns his face this way, then that, stretches the skin of his cheek with his left hand while scraping at it with the razor in his right, pulls clownish expressions to tighten the muscles, seems to be peering intently into my eyes. I want to look away, but I can't. I make a joke about putting the videos on YouTube. Powell laughs politely, and says they take the panellists' privacy very seriously.

"It was only when I came here that I realised I'd been married to my husband for so long and I'd never watched him shaving," says Kristina Vanoosthuyze, one of Gillette's senior scientists. "I stood next to him. 'How are you shaving exactly?' "

Stewart, too, takes a professional interest in her other half's grooming habits: "After a while, he says, 'Do you know what? Can I just shave without you asking?' " Vanoosthuyze's husband eventually told her to "Go away and leave me alone!" she jokes.

Powell brings the conversation back to the matter in hand. "You can never spend too much time with consumers," he says. "It's amazing what you will learn from them."

Down the hall from the high-speed video lab is the room where they do three-dimensional motion analysis using infrared cameras: "It's the same system they use in some of the latest blockbusters, like Spider-Man or Lord Of The Rings." The changing positions of markers that reflect infrared light are triangulated by the cameras, so the movements of the razor and the shaver's arm can be recreated in a virtual 3D space on a computer. "The way in which you hold that handle and you rotate that handle, if you watch men do it, it's quite amazing. You think they could all be cheerleaders," Stewart says. High-speed infrared cameras, running at around 2,000 frames a second, are also used to measure skin deformation and strain. A similar technique is used in the car and aeroplane industries, though Gillette have patented it for shaving research. Next door, sensors in a specially adapted razor measure the forces different men put on it while shaving.

Analysis of all the data from all the different studies gives the researchers an idea of where there might be room for improvement, so the next stage is to build a new prototype the panellists can try out to see if it's any better. The razors are built virtually at first, using computer-aided design. These models are then turned into physical ones downstairs in the rapid prototyping area. The models are made by building up very, very thin layers of plastic, one on top of another. Dom Piff points to the work going on in one of his machines. "That's a very large part for us," he says. "It's like trying to cut Wembley football turf with an eight-inch blade." His fastest machine is the 3D printer, "which is kind of like precision bombing". Eight printheads, with 97 nozzles on each, pass from left to right, spitting out a liquid polymer that is instantly solidified by the ultraviolet light following behind. It makes a noise like a desktop computer printer, only louder. Piff gives me a souvenir: a blown-up plastic model of a Fusion cartridge with my name engraved on it.

The machines that cut the metal parts in the working prototypes are accurate to within plus or minus 1.5 microns (thousandths of a millimetre). "This is levels of accuracy greater than the watch-making industry," Stewart shouts over the noise of the equipment. "More in among the medical industry." The incredible levels of precision have been emphasised all the way round the facility. Presumably that's the subtext of using Roger Federer, Tiger Woods and Thierry Henry in the Fusion ad campaign: here's a combination of more precision and accuracy than you know what to do with. "If you take away only the one thing," Powell says, "that's precision. And the consumer. That's it."

You could be forgiven for thinking magnification was a major theme, too. Using a device called a micro-watcher, I was able to inspect my chin at 200 times lifesize. I hadn't shaved for a couple of days. The hairs looked revolting, the black ones like great greasy sticks of liquorice, the pale ones like shards of dirty glass. In the electron microscope area, there are pictures on the wall of various blade edges enlarged thousands of times: kitchen scissors, a kitchen knife, a surgical scalpel, a Fusion blade. Guess which is the sharpest. "To be fair, the surgical scalpel is being asked to do a different task," Powell says.

Each blade in a Fusion cartridge consists of a stainless steel core, coated with very thin layers of diamond-like carbon, for strength, and a Teflon-like polymer to reduce friction. I ask about planned obsolescence: a razor blade that never went blunt would be bad news for the industry. Stewart's answer implies that the idea of an unbluntable razor is a fantasy. "You clearly don't want something that's fantastic but lasts one shave, because clearly that's not great for the shaver." I think this means you can't have both maximum sharpness and maximum durability, so you need to find a compromise.

"The only reason anything ever is in that razor is because it delights guys," Powell says. "There is not one thing more in there than is needed to delight them. There are no gimmicks, no funny things, it's all about performance," he adds, though, when pressed, he does admit "there's a cool toy factor built into it".

According to Gillette's own research, two out of three men prefer the Fusion to the Mach3. "It's what guys seek," Powell says.

They give me a Fusion Power Stealth to take home - more freebie marketing; I'd never have bought one - and I have to admit it is nicer to shave with, and gives a smoother result, than my old Mach3 (I reluctantly traded up from the SensorExcel a few years ago because Sainsbury's didn't have replacement blades). The single blade on the back is particularly handy. I can't say the friction-reducing vibrations do much for me - around the mouth, they feel as if you're having your teeth scaled and polished. The electric beard-trimmer on the end of the Wilkinson Sword Quattro Titanium Precision makes more sense (or would, if I had a beard that needed trimming).

The point of the microchip in the Power models, incidentally, is threefold: to control the electrical discharge from the battery, so vibration levels are constant across the battery's life, rather than gradually weakening as it drains; to switch the motor off after eight minutes, in the event that it has been switched on accidentally; and to control the low-battery indicator light. It also allows the researchers to "do things in terms of learning things about the consumer," Powell says, hastily adding: "In our prototypes, clearly not in the product, in our research."

Both firms are unsurprisingly cagey about where that research is taking them. I ask Wilkinson Sword if they have a six-bladed successor in the pipeline. "RD&E [research, development and engineering] is working consistently on upgrading our products," they say, "and is evaluating all opportunities that our technologies are offering us." That's a resounding "maybe", then.

I was more than persuaded by both firms that the technology isn't some kind of con: the researchers I met were all gifted, dedicated people, responding with infectious enthusiasm and flair to the real technical and intellectual problems with which they were presented. So, yes, the business is about fulfilling the consumers' desire for a better shave. But it's also about creating that desire: if the two out of three men who prefer the Fusion to the Mach3 had never been offered the Fusion, they'd never have known what they were missing. Still, that's capitalism for you. If you wanted an allegorical portrait of modern western capitalist society, you could do a lot worse than a man alone at a shaving mirror, intent on his own reflection, while from the other side of the glass a vast global corporation is watching, recording and planning what to sell him next.