In general, milk is not known for a spectacular shelf life. Even milk that's been pasteurised, so a good many of the bacteria naturally present are dead, will go off after about 10-15 days in the fridge, and that's being generous. But for the last 50 or 60 years or so, milk that lasts not days, not weeks, but months and months without refrigeration has taken up a place on grocery store shelves. The ubiquitous waxed-paper boxes contain milk that's had an interesting treatment, with some effects that are obvious and others that you may find more surprising.

The process that leads to this UHT, or ultra-heat-treated, milk is incredibly brief, compared to normal pasteurisation. Named after Louis Pasteur, who pioneered the idea, pasteurisation is aimed at killing tuberculosis bacteria and a few others that cause disease. It involves heating milk to 72C (161F) for about 15 seconds, then cooling it down. It doesn't kill everything, and many bacteria that aren't particularly harmful as long as the milk is refrigerated and consumed quickly remain. Most of the milk drunk in the United States, Australia, and New Zealand is of the pasteurised variety, says Hilton Deeth, a dairy expert recently retired from University of Queensland.

However, in many European nations, UHT milk is the norm. This milk is heated to double the temperature - 140C - for a mere three seconds. The high heat does its work almost instantly, killing all bacteria and most of the bacterial spores that can stand up to lesser temperatures. Because it's nearly sterile, as long as it is packaged in a container that's aseptic, it will last and last. No bacteria means no spoilage, at least as long as the package is closed. 

You can't do just anything to UHT milk, cautions Deeth. It's designed to last at about 20-30C, so if it's shipped across the equator on a sweltering ship, or languishes on a dock somewhere in the tropics for a while, some of those remaining spores may come active and cause problems. And peculiar things do happen sometimes to that everlasting milk in its cloistered existence. It can form a gel inside the package, so when you open it and try to pour it, "it looks a bit like a yoghurt or a custard, or it has lumps," says Deeth.

UHT milk has more or less conquered the milk market in many places in the world  

The reason that happens can be found in the chemistry that goes on during its treatment and which contribute to some of its odd qualities. With that brief, intense heat comes a change in the milk's proteins. The whey proteins become unravelled, turning into limp strands. The Maillard Reaction, famous for creating the delicious flavours of caramel, perfectly browned toast, and bacon, as well as many other foods, occurs between the milk's proteins and sugars. An array of enzymes also fall apart, although not, crucially, an enzyme called plasmin, unless the milk is pre-treated to eliminate it. A variety of sulphur compounds are created, giving the newly treated milk an eggy stench that almost entirely dissipates after about a week.

If plasmin stays active, it will go around slicing up various proteins, releasing them from whatever they were doing before and allowing them to form attachments to each other. This seems to be what generates the gel-like agglomerations. The Maillard Reaction is likely behind the fact that UHT milk is noticeably sweeter than its pasteurised cousin. UHT milk is also usually whiter than pasteurised, in fact, Deeth notes. This seems to stem from the way that the unfurled whey proteins and other substances reflect the light. And the sulphur molecules do give it a certain cooked tang to many palates.

While not everyone loves the flavour, UHT milk has more or less conquered the milk market in many places in the world. For instance, it is omnipresent in China, where the appetite for milk has been growing by leaps and bounds. "There's been something like a 10% increase per year for several years now," says Deeth. "The amount of UHT milk in China is huge." Milk industry growth in places like Australia, New Zealand, and Germany has been driven in part by exporting shelf-stable milk to China.

One downside, however, to this long-lived beverage: it is impossible, pretty much, to make cheese from the stuff. Cheese is a two-step process, with proteins being sliced up by rennet enzymes and then agglomerating to make the curd. It seems, Deeth says, that the relaxed whey proteins, straggling all through the mixture, get in the way of the curd coming together (pasteurised milk, where only 5-10% of whey is denatured, has no such problem). Not that Deeth hasn't tried. He and a post-doc have tested all sorts of conditions, to little success.

"I went in one morning," Deeth recalls, "and he said, 'I got some curd from that cheese…[but] I left at 1 am.' Cheese normally sets after a couple of hours, but that one took 11 hours get anywhere close. "I think there's room for research to make UHT milk cheese," he reflects. But it would likely be something like cottage cheese, with a great deal of moisture.

And it would not, thanks to its lack of working enzymes, grow more delicious with age.

Join 800,000+ Future fans by liking us on Facebook, or follow us on Twitter.

If you liked this story, sign up for the weekly features newsletter, called "If You Only Read 6 Things This Week". A handpicked selection of stories from BBC Future, Earth, Culture, Capital, and Travel, delivered to your inbox every Friday.