Like so many elements of the fashionable lifestyle of today, the modern festival was born on America's west coast. In the early summer of 1967, 50,000 people travelled to the Monterey County Fairgrounds in central California, attracted by a line-up that eclipsed anything promoters could dream up today. On the first day, Friday 16 June, they saw, among others, the Animals and Simon and Garfunkel; on Saturday they saw the Byrds, the Steve Miller Band, Jefferson Airplane and Otis Redding; on Sunday they saw the Who, Jimi Hendrix, the Grateful Dead and the Mamas and the Papas. Never before had so many big names shared the same bill; never before had so many people gathered to celebrate the music that defined a decade. The sunlight sparkled, the California sky seemed a perfect blue and the musicians performed for free. It was all a very long way from the driving rain, muddy wellies, strict security and £200 tickets that characterise the modern British festival summer.
Whether you think that 21st-century festivals have preserved the spirit of this vanished age, or that they have betrayed its subversive potential, rather depends on what you think of the Sixties. Whether veterans of the era like it or not, the decade of peace and love was also a time when promoters and record companies made an awful lot of money. But there is more to the festival's prehistory than the Summer of Love, because although jamborees such as Glastonbury and Latitude like to wallow in the Sixties spirit, their origins stretch back much further than many of us realise. The very word "festival" is closely related to "feast"; both were originally used in the Middle Ages to denote basically religious occasions. On the face of it, religion has little place at the modern rock festival. But when you see the crowds of worshippers stretching out their arms towards the tiny figures on stage, voices hoarse, roaring out ritual incantations, you wonder whether the substance of things has changed.
In some ways our modern festivals are not so different from the entertainments that meant so much to the ancient Romans - the great public games that were timed to coincide with holidays to honour the gods. Then, as now, festivals were big business. Today they attract millions in sponsorship from big corporations; in classical times, ambitious Romans used them as opportunities to show off their wealth and curry favour with the populace. Then, as now, festivals provoked harsh criticism from moral conservatives, frustrated at the public's enthusiasm for spectacle and sensation. The Roman people, grumbled the poet Juvenal, the Daily Mail columnist of his day, had taken a keen interest in serious political affairs once, but now all they cared about was bread and circuses - panem et circenses - the lament of would-be reformers down the ages.
The Romans' love of feasts and festivals casts a long shadow. Some scholars see the Saturnalia, which lasted for a week in late December, as the ancestor of Christmas, and the mixture of religious ritual and present-giving does sound tantalisingly familiar. "It is now the month of December, when the greatest part of the city is in a bustle. Loose reins are given to public dissipation; everywhere you may hear the sound of great preparations, as if there were some real difference between the days devoted to Saturn and those for transacting business," the poet Seneca complained. The advent of Christianity evidently did not change much: writing in 400AD, the bishop Asterius said that the festival was "misnamed a feast, being full of annoyance; since going out-of-doors is burdensome, and staying within doors is not undisturbed. For the common vagrants and the jugglers of the stage, dividing themselves into squads and hordes, hang about every house."
Asterius's exasperation at the "foolish and harmful" revels of Christmas has echoed down the centuries. During the Middle Ages, which was a great era for festivals, monks and scribes often bewailed the high jinks on "holy days" - the formula that gave us the word holiday. It was best to avoid London on May Day, one chronicler advised visitors in 1193, because it was crowded with drunken "stage-players, buffoons, musical girls, druggists, lustful persons [and] extortionists".
Alarming though the prospect of all those druggists was, there is little doubt that medieval Englishmen had a better idea of how to enjoy themselves than we do. The experience of going to modern rock festivals - a weekend's release after months of office drudgery, for which you pay a princely sum to sleep in a rain-sodden tent surrounded by other exiles from the Guardian-reading enclaves of north London - could hardly be less like the unaffected localism of their medieval equivalents.
Even within London there was a vast range of local traditions, from the Barnet horse fair every September to the Jack in the Green parades to mark the onset of summer. People ate and drank to excess; they laughed at dancing bears and performing dogs; they marvelled at the stalls of exotic fruit, such as oranges, lemons, figs and pomegranates. They played rudimentary versions of football, hockey and tennis; they watched street shows and morality plays; sometimes they watched jousts and tournaments. And, as at modern festivals, music played a central role. As the historian Ian Mortimer writes in his Time Traveller's Guide to Medieval England, this was an age of music-making that was collective in the proper sense, from crowds of hand-holding dancers to "young women doing the erotic dance of Salome".
Elsewhere, in the heart of Middle England, market towns prided themselves on their "mop fairs", marking the end of the working year every October. Every year, farmworkers, labourers and craftsmen would march in their Sunday best, wearing emblems of their trade. Waggoners wore pieces of whipcord in their hats; grooms wore a lock of horsehair. Lowlier workers, those lacking any particular skill, wore a piece of mop - hence the name of the fair.
Once again, business interests predominated: prospective employers circulated among the crowd, checking out the talent. When an employer found a worker he fancied hiring for the coming year, he would give him a token retainer, and the worker would remove his badge and put on a bright ribbon, indicating that he had been taken. But workers and their money were soon parted; they most probably spent their retainer at the stalls in the market square, enjoying the food, ale and games on offer before the working week began again.
Many Cotswold market towns still have mop fairs today, though the festivities are very different from the original medieval celebrations. In my home town, Chipping Norton, the mop fair is dominated by gigantic rides, inedible candyfloss and groups of teenagers standing around, sullenly clutching cans of cider. Every year, you can hear many complaints about antisocial behaviour, but it was ever thus. Today's teenagers are merely the successors to yesterday's medieval buffoons.
Although some historians love to see these festivals as ripe with countercultural potential, I have never been convinced that there was anything very subversive about them. Festivals were an accepted and familiar part of the annual calendar, rooted in religious practice.
In times past, people often complained about the excessive drinking, fighting and fornicating, as they do today, yet these things posed no grave threat to the established order. And even though many towns celebrated feasts of fools, when figures of authority such as the local bishop made way for mocking caricatures (a "boy bishop", for example), these were safety valves, in effect allowing people to let off steam without meaningfully challenging the way things were.
Fairs and festivals were a form of escapism, but they were also the stuff of daily life. And, at bottom, they were gigantic exercises in making money: after all, none of those dancers and druggists was out celebrating purely for the good of their own health. In this respect, as in so many others, they were not so different from modern festivals after all.
Dominic Sandbrook is a contributing writer for the New Statesman