Fragonard's portrait of the 5th Duc d'Harcourt sums up an age when appearance was everything. Robert Tombs describes the performances, masquerades and theatrics at play in the court of Louis XV

If you did not live through the years before 1789," sighed Charles Maurice de Talleyrand-Périgord, aristocrat, bishop, libertine and politician, "you cannot know the real pleasure of living." Even allowing for post-revolutionary nostalgia, it is easy to see what he meant. France's aristocracy ruled Europe's richest and most powerful state, formed the apex of a society whose splendid lifestyle was envied and copied internationally, fostered an Enlightenment culture that shaped the West, and not least enjoyed themselves extravagantly in the process. To find parallels we would have to think of a few other golden ages – ancient Athens, imperial Rome or the refined courtly cultures of China and Japan.

Golden ages inevitably have their dark sides: that of France, which lasted a century from its rise under Louis XIV through its decline under Louis XV and its collapse under Louis XVI, ended with châteaux in flames, heads on pikes or long years in exile for the lucky ones such as Talleyrand or François-Henri, 5th Duc d'Harcourt, the subject of a superlative painting by Jean-Honoré Fragonard to be offered at Bonhams in December.

The characteristic of France's elite society was its concentration round the court at Versailles, the grandiose palace-town created by Louis XIV in the 1680s and which by the 1780s numbered 50,000 people.

The aim had been to gather France's feuding nobility together under Louis's eyes, and to elevate him as the 'Sun King' around whom political, social and cultural life orbited. As jealously chronicled by the Duc de Saint-Simon, the king's life – from his lever to his coucher, his prayers, his meals, his amusements and not least his amours – became an unchanging theatrical display in which the minutely graduated status of the elite was delineated: the grandees who could sit in the king's presence, ride in a royal carriage, open his bed-curtains, pour his wine, hand him his shirt, take off his boots. Down the hierarchy it went: from the Clockmaker of the Bedchamber who wound up his watch via the Grand Footman who carried the queen's parasol to the humble bearers of the royal commode (who continued to be paid after water closets were installed). On great occasions, thousands of people filed past to gawp at the royal family eating their dinner or playing cards.

This was the brilliant, seething world of which Fragonard and d'Harcourt were typical, if unusually distinguished, denizens: one the purveyor of cultural luxuries to the great; the other an aristocrat whose prominence at court and in affairs of state was both a right and a duty. Fragonard, born in 1732, son of a Provençal glover, won the prestigious Prix de Rome at the age of 20. Braving academic disapproval, he turned away from standard religious and mythical subjects to create during the 1760s and 70s sophisticated and sometimes risqué works for the aristocratic elite, such as The Bathers, 1767, in the Louvre, The Swing , 1767, in The Wallace Collection, and Girl Playing with her Dog, c.1770, in Munich's Alte Pinakothek. These were marked by more or less open eroticism and bravura composition and execution. As a respectable critic sneered, "Instead of working for glory and posterity, he contents himself with showing off in boudoirs." A major work of this time was The Progress of Love, 1771-3, for Madame du Barry's hideaway.

Fragonard's 'fantasy portrait' of d'Harcourt, one of an enigmatic series of similar works, is emblematic of its times. The antithesis of the standard boring portrayal of the standard pompous grandee, it is a rapid oil sketch of a man so sure of himself that he is happy to be shown in an unguarded moment, in fancy dress, with a jaunty swagger, and in a daringly casual style. Thus was demonstrated the sophisticated taste of artist and patron, for whom effortless superiority was the ideal of true aristocracy.

But far away in the outer darkness lurked not only the mass of commoners, but also most of the nobility who lacked the money or a sufficiently ancient title – pre-1400, verifiable by the Royal Genealogist – to be presented at court. France's nobility was a cascade of disdain, in which great courtier families despised those of recent ennoblement (the majority), those descended from lawyers and administrators (the noblesse de robe) or those rustic squires condemned to vegetate in distant provinces or, like so many d'Artagnans, to seek their fortunes at the point of their swords as junior officers in France's huge army. But there were never enough jobs to satisfy everybody.

Proximity to the royal person offered the lucky few power, prestige and perquisites. If boring administration was carried out by professionals, the honorific posts went to those with the luster of ancient lineage: those few families traceable back to medieval warriors, the noblesse d'épée, such as the Montmorency, La Fayette, Noailles and d'Harcourt dynasties (these last great Norman feudatories since William the Conqueror), or those whose names needed no further introduction, such as the family of the great Cardinal Richelieu. To them went the glory and the rewards: as governors of provinces, military commanders or guardians of royal children – the Duc d'Harcourt served in all those capacities. Not all were good at their jobs, but we should not assume that all were mere ciphers. They were trained from childhood in a range of talents – political, military and also artistic. Many, like the king himself, were patrons of the arts. D'Harcourt was among these. He had his own private theater, wrote a book on the fashionable subject of gardening and was elected to the French Academy.

Performance was an essential part of aristocratic life, and the part had to be played with grace and distinction. In theory these qualities were natural products of noble birth; but in practice they had to be learnt – from music masters, fencing masters, riding masters and dancing masters, who taught not just minuets and gavottes, but manners and deportment. As one experienced courtier noted, appearances were more important than realities.

Court ceremony was something that nobles fought viciously to be part of, but also found intolerably stultifying. The Austrian Marie-Antoinette (married in 1770 to the future Louis XVI) discovered that she could not have a glass of water if the right lady-in-waiting was not there to hand it to her. They sought relief from the tedium: in secluded private apartments; in the beds of mistresses (Louis XV had his own personal brothel); in smaller châteaux within the château, such as the Petit Trianon; in Marie-Antoinette's toy village; and, for the great courtiers, in holidays on their own estates. Hence the fancy dress, the lavish fêtes galantes immortalized by Boucher, Watteau and Fragonard, recalled by the d'Harcourt portrait with its archaic costume.

Court culture reached its high – or perhaps low – point during the second half of the 18th century under Louis XV and XVI, the former a shy depressive swayed by his many mistresses, the latter a well-meaning slave to his wife. These women provided ways of exerting influence over their kings.

This is perfectly shown by the career of Louis XV's most famous and influential mistress, the Marquise de Pompadour, born plain Jeanne-Antoinette Poisson, the protégée and agent of a syndicate of bankers. She was financed, provided with a complaisant husband, schooled, dressed and, aged 24, introduced to the king at a masked ball in 1745. He took the bait, and she became the Marquise de Pompadour, her estate and title bought by the syndicate. Her job, as she saw it, was keeping the king amused, and this made her the lynchpin of a financial-political-sexual complex that dominated politics until her death in 1768.

A year later – around the time Fragonard was painting his fantasy portraits – the gorgeous, funny, featherbrained Jeanne Bécu, the call-girl 'Mademoiselle Ange', succeeded Pompadour and was created Comtesse du Barry. This was going too far for the court nobility and for the wider public, who tolerated royal philandering with suitable ladies (Ms Poisson had been barely acceptable), but not an open liaison with a greedy whore with political pretentions. Louis XV ended his long reign despised and detested. This was not forgotten: more than 20 years later, when revolution came to France, Mademoiselle Ange and 28 great bankers ended on the guillotine.

Louis XVI, who succeeded his grandfather in 1774, was determined to be different. He was well meaning, hard working and – most unusually – faithful to Marie-Antoinette. Yet their court was even more scandal prone, and they too ended on the guillotine. Accusations of sexual decadence and reckless extravagance, especially by a too trusting Marie-Antoinette (an 'airhead' according to her brother the Austrian emperor), have always been part of the story. But we should have a pinch of salt at hand. Accusations directed at the queen were partly xenophobia – Austria was widely hated – and partly a politically motivated attempt to undermine the monarchy (as well as being a nice earner for hard-up pornographers). Royal extravagance in the 1780s was in some ways an attempt to boost the economy – primitive 18th-century Keynesianism. Fatally for the monarchy, France was in decline, its power challenged, its finances in ruins, and this caused discontent at Versailles and an internal crisis of confidence.

D'Harcourt himself, as governor of Normandy, led a protest against Crown policy in 1771. He was not, however, one of those radical nobles who led France into revolution: he was one of the first to flee the country in 1789, and died in exile in England in 1802. But Fragonard's portrait of him is d'Harcourt's mark on history: a picture, that surely shows us what Talleyrand was getting at.

Professor Robert Tombs is co-author of That Sweet Enemy: Britain and France, the History of a Love-Hate Relationship.

Related auctions