It was the August bank holiday. The rain was going from drizzle to downpour and as I peeped out of my weather-beaten tent to survey the landscape at the Reading Festival, the last thing I wanted was another cereal bar. Or another Babybel, another bag of crisps – or any of the other provisions I'd so frugally packed the Friday before. So half an hour later I found myself sitting opposite an infinitely more appealing plate of grilled halloumi, rocket, aubergine and roast peppers, accompanied by a hefty wedge of focaccia.

While my fellow campers squatted in fold-out chairs, I was enjoying a proper, plush dining set-up complete with – and this is the best bit – table service. Until recently, there were festivals and there were food festivals. Traces of overlap were few and far between – music fans made do with an over-subscribed Mr Whippy by the main stage, a row of burger-noodle-hot-dog stands or, perhaps, if they were lucky, a hemp burrito by the folk tent. Food was less something to be savoured, more a means to an end – a bit of stodge to fill a hole, resented long after for its inflated price.

Lately things have started to change. After years of dedicated Reading attendance, last year's moment of fine dining was a revelation – and part of a growing trend. Visitors to this weekend's Glastonbury Festival can enjoy a similar experience, popping into the Hurly Burly tent for a spot of lunch served by performing waiters or dropping by the Tea Shop for tea and cake in a double-decker bus cum tearoom.

If that doesn't appeal, there's the Tapas Patatas tapas bar, the Tree House Café (complete with panoramic views) and the Lamb Joint for a traditional Sunday Roast. Eating at a festival is a whole lot more civilised than it used to be. It's better, too.

At Glastonbury this week, there will be hundreds of stands selling food, ranging from the bog-standard to the brilliant. Whether it's artisan, vegan-friendly pizza at Fire in the Hole, West Country raclette from Eat Bristol or hand-made elderflower cordial from the Festival Elderflower Company, there is something for just about every palate.

The same is true elsewhere. At the Big Chill in August, foodie treats will range from Savoyarde delicacies (la tartiflette originale, saucisses au vin blanc) to freshly made sushi and home-smoked meat and fish. At July's Latitude there will be oysters and venison from Food of Argyll, juice and smoothie bars and an all-day barbecue.

But it's not just established festivals getting in on the act. Quite the opposite – it's thanks in large part to a crop of smaller events that standards started to improve in the first place. "The whole thing began a few years ago when a new breed of festivals emerged," Petra Barran, who founded the Choc Star van, says. "When it came to arranging catering they looked to individual traders to offer something unique. Pitch fees were modest, which meant that there was no need to lower standards."

Having peddled her brand of high-quality chocolate goodies at events around the country, Barran is something of a festival veteran. Her favourites, though, are still those smaller occasions: Port Eliot and Kimberly festivals. "Some festivals really have a focus on food, even though they aren't specifically food festivals. You don't need to pay through the nose and they can be really off-beat and interesting."

It was with this in mind that Jimmy Doherty founded Harvest at Jimmy's in 2009. "Growing up, I always liked the idea of going to a fête," Doherty says. "You don't want an event where it becomes dominated by the big, corporate brands. It needs to be possible for the small artisan cheese-makers to set up stalls. You need variety."

Unique in that it was neither a food festival nor a music festival but a bit of both, it brought together established performing artists and genuinely enjoyable grub. "The thing is, Britain's a world leader in music and we're a world leader in food and agriculture," Doherty says. "It's a natural combination."

So successful was the formula that this year a spin-off is to be launched: Alex James Presents Harvest, hosted by the cheese-loving former Blur bassist. As well as performances from bands including the Futureheads and Athlete, punters will be able to enjoy food whipped up by Hugh Fearnley-Whittingstall, Yotam Ottolenghi and Mark Hix. "Festivals used to be a case of having a dodgy burger in a limp bun but that doesn't have to be the case any more." Even Jamie Oliver is getting in on the act: his "Feastival" launches this year in Clapham Common.

Of course, catering for the several thousand who descend upon the summer's festivals is no mean feat. Even less so when the quality of food is paramount. Yianni Papoutsis, owner of London's acclaimed Meatwagon, prides himself on serving only the freshest ingredients. "It's a massive operation," he says. "Everything you need for a kitchen, you need out in the field." Every day of his three weeks touring around the country's festivals, ingredients will be delivered fresh.

"You're literally living and working at a festival for a week at a time," Papoutsis says. "You need to be prepared for all weather. It's exhausting, but also brilliant to be part of such a big thing."

Papoutsis will be putting in appearances at Harvest and – away from the Meatwagon – at Glastonbury as part of the Beat Hotel bar. But the highlight of the summer looks likely to be next month's Secret Garden Party, where he will be dishing up his trademark burgers to the event's staff and production crew. "I did production for 15 years and you often don't get taken care of," he says. "I always try to step it up and make it something special."

This is something most festival-goers don't realise. Away from the hustle and bustle of the main festival, a whole other catering operation is under way; one rarely seen by most of the punters, with its own set of pressures and standards. Most festivals will provide breakfast, lunch and dinner for festival staff, be it carefully crafted burgers or mass-produced fry ups. The task is huge: at Glastonbury 1,600 people are employed simply in the task of building and dismantling festival infrastructure. Amid this melee, facilities like those offered by the Salvation Army at Glastonbury, Reading and Leeds can be invaluable; doling out cups of tea, coffee, soup and advice for those too broke or too tired to go in search of the gourmet option. "We see a lot of people down to their last few pounds – festivals can be so expensive," Jon Cole, a volunteer who worked at last year's Leeds festival, says. "Over the whole weekend, we serve about 19,000 drinks."

At the other end of the spectrum, there is the equally daunting prospect of providing for the VIP area. There, unlike the rest of the festival, the food vendors are paid for their presence; rather than applying to rent a space, they're carefully selected by festival organisers and invited to appear.

The result is a treasure chest of riches. Reading and Glastonbury offer private "restaurants" for their special guests. At the Big Chill, London's Giant Robot will operate a pop-up restaurant and cocktail bar (sample dish: red snapper fillet with baby beetroot, wild celery, citrus and prosecco). Harvest will give guests the chance to relax in a private garden, complete with hammocks, sun loungers, a champagne reception and resident DJs from the Notting Hill Arts Club

But it's the V Festival where the big guns are rolled in. The so-called "Virgin Media Louder Lounge" is renowned for its bounty. In contrast to most festivals, food and drink is entirely free to guests. This year, that will incorporate a revolving menu of locally sourced dishes whipped up by private caterers (dishes will include "lightly smoked mackerel fillets with a chilli dressing" and "butterflied, minted lamb with cherry tomatoes") as well as a dedicated crêpe stand, a local ice cream maker and a representative from the Real Coffee Club. "We want people to realise that just because you're at a festival, it doesn't mean you have to compromise on food," Virgin's Simon Dornan says.

It's not just food the that's luxurious either. For the duration of the festival, Kensington Roof Gardens will operate a pop-up bar, complete with replica pond and expertly mixed cocktails. "Part of the experience is treating people to something that might be better than they'd get at home," Dornan says.

For one weekend of festival frolicking, it's a lot of effort. Suppliers arrive days ahead and leave long afterwards. Post-festival clean-ups are famous undertakings; more than 1,650 tons of rubbish is left behind at Glastonbury each year. But for those involved, it's a once-a-year chance to be part of something beyond the realms of their day-to-day trade. "You work crazy hours and live by your van, but you meet all kinds of people," Barran says.

"I've got so many memories: watching Amy Winehouse on stage from my van, serving Matt Lucas ice cream. It's just really, really fun." And that, after all, is what it's all about.

What to eat, what to drink – and where

Beat Hotel Glastonbury

Slap bang in between the Pyramid and John Peel stages, the Beat Hotel – the brainchild of cocktail maestros Soulshakers and event-organisers Kingdom Collective – will be serving up cocktails and a smoked barbecue. Special-guest DJs will play all day.

Choc Star at Port Eliot, Kimberly, Alex James Presents Harvest and the West Dean Festival

Petra Barran's repertoire includes chocolate Guinness cake, walnut-fudge brownies and Italian hot chocolate. But it's her ice cream that promises to be the main event if the sun's shining: think Mexican chocolate, rocky road and mocha.

Tiny Robot at Latitude and The Big Chill

Table service, proper cutlery and crockery and – best of all – top-notch food and drink. Last year the Robot crew dished up grilled red snapper, butternut squash and ricotta tortelloni, peppercorn steak and ice cream sandwiches, all washed down with their special martini royales.

Kensington Roof Gardens at V Festival

It doesn't get much plusher than London's Kensington Roof Gardens. Their pop-up at the Virgin Media Louder Lounge promises to bring glamour to festival-goers at V. Think Bloody Marys for the morning after.

Salvation Army at Glastonbury, Reading and Leeds

Whether you're hungry, lost or just want to chat, the Salvation Army is on hand. Soup, coffee, tea and biscuits for just £1. In festival terms, that's practically free.