This was a year in which – to adapt the ending of George Orwell's Animal Farm – TV viewers looked from The Thick of It to British politics, and from British politics to The Thick of It; but already it was impossible to say which was which.
The Goolding inquiry, which in the series investigated the relationship between politicians and the press, overlapped with the Leveson inquiry into similar intimacies at Westminster. A word coined by the show's latrine-larynxed Malcolm Tucker to describe overlapping political incompetence – "omnishambles" – was first borrowed by Labour leader Ed Miliband to describe the coalition and then parodied as "Romneyshambles" during the unsuccessful Republican candidate Mitt Romney's disastrous tour of Europe.
There are two standard templates for the rhythm of a successful TV series: starting with eye-popping confidence before progressively disappointing (Homeland, Lost) or finding the right feel and themes only in the middle years (Only Fools and Horses, Spooks). It's unusual, and even inadvisable – for obvious commercial and artistic reasons – for a show to peak at the end. But The Thick of It, in 2012, confirmed its indispensability at the moment that creator Armando Ianucci dispensed with it after seven years that brought four series and a loosely spun-off movie.
The reason for this glorious creative climax was that Orwellian blurring between the satirical pigs in the series and the Westminster men and women. Although the early series of The Thick of It were always smart and classy, they operated after the fact.
While the political parties are never identified – one of the tricks Ianucci learned from Jonathan Lynn and Anthony Jay's Yes, Minister/Yes, Prime Minister (BBC1, 1980-88), openly the show's less-profane ancestor – The Thick of It was initially a satire of New Labour. Where Lynn's and Jay's governing joke was that the country was really run by urbane civil servants, the younger series showed how the strings of Britain's politicians were now being pulled by a different unelected elite: a brutal group of image manipulators and special advisers.
By the time The Thick of It premiered in 2005 on BBC4, however, Tony Blair had already won three election victories and Alastair Campbell – clearly spiritually, if not legally, the inspiration for Tucker – was, in contradiction of his supposed background role, a public figure.
As a result, the early series were cathartic – channelling the electorate's anger about spin and wars – rather than prophetic or influential, as the latest run became. There was also an early risk that the show would finish as a short-run minor cult when it suffered the thematically fitting but logistically destabilising shock of the central actor having to resign. Chris Langham – who played the Department of Social Affairs and Citizenship's first secretary of state, Hugh Abbot – was convicted and imprisoned in 2007 for downloading indecent images of children.
That event slightly complicates The Thick of It's position in TV history as series one and two have suffered a sort of moral pixillation: especially after the Jimmy Savile scandal (although the presenter's alleged crimes were of a very different order to Langham's), it seems unlikely that the BBC would ever now accord The Thick of It the pilot-to-finale reruns or themed evenings that are normally the reward of a TV classic.
But, though shattering for Langham and his family, the crisis was survivable for The Thick of It in a way that could not have been the case if the actor had been playing a paterfamilias in a domestic sitcom. Disappearing suddenly because of scandal is exactly what happens to many secretaries of state and – after a pair of transitional special episodes in which Abbot was supposedly "in Australia" – the show began its claim on greatness with the 2009 third series in which Rebecca Front's Nicola Murray moves into the department at a point when the never-seen PM (another lesson learned from Yes, Minister) is handing over to his long-frustrated party rival. In an awful way, the shadow of Langham's departure may even have heightened the sense of political reality.
Yet, improbable as it now seems, the show could again have ended at this point. In common with most of the journalistic and political nexus, Ianucci and his writers had assumed a Conservative victory in the 2010 general election and Roger Allam's Peter Mannion had been positioned during series three to become the central focus. After the formation of the Cameron-Clegg coalition, the fourth series was delayed and Ianucci seemed potentially lost to America, following the success of the spin-off movie In the Loop and his HBO series Veep. At that time, I bumped into a leading actor in The Thick of It who despaired that Cameron's failure to win a majority had lost him what had seemed to be a guaranteed year's work. The actor's tone, in another uncanny overlap with politics, was that of a politician who had failed to achieve the expected office.
In retrospect, though, In the Loop had revealed a new aspect of the talent of Ianucci and his writing team: the ability to be Cassandra dramatists, anticipating political reality. In the movie, Oscar-nominated for its screenplay, a politician played by Tom Hollander has a riff about his fondness for porn movies: the revelation that the husband of then home secretary Jacqui Smith had charged adult films to her parliamentary expenses coincided with the film's UK release, feeling eerily like a promotional campaign for it.
Continuing this rhythm, this year's glorious fourth series of The Thick of It consistently found the show not firing barbs afterwards – as satire generally does – but being ahead of or alongside the game.
As the real-life coalition was hastily reversing its policy on numerous issues, including the pasty tax, the on-screen two-party government was chaotically decommissioning a Digital Britain initiative after a failed launch. When Jeremy Hunt lost his bell-end during a campanology stunt to launch the Olympics, he seemed to be parodying several presentational disasters by Mannion.
And, while the Goolding inquiry clearly drew on the Chilcott and Leveson investigations, Ianucci's tribunal was able to cast doubt on the veracity of participants in a manner impossible for reporters of the actual inquiries. The moment when one of Goolding's QCs is absent from the media leaks inquiry, because Tucker has leaked a story about her to the media, sharply dramatised the tensions surrounding Leveson and, with yet more spookiness, coincided with the Daily Mail running several pages questioning the independence of one of Leveson's team.
The show became such a running commentary on events around Westminster that Martha Kearney, presenter of Radio 4's The World at One, told me that the programme was forced to make a formal decision to ration the use of clips from The Thick of It to introduce political items.
The closeness of the real 2010 election also proved to be a boon to the writers (including Tony Roche, Simon Blackwell and Ian Martin) not only because coalition is inherently tense and comic but because, with a fragile government, the opposition party remains relevant, averting what once seemed to be the terrible likelihood of a fourth series without Tucker. And the spin doctor is even funnier trying to retain power than he was enacting it. Capaldi has always brought startling rage and energy to the role but, as Tucker faced up to the possibility that his time is over, he seemed to be acting on the very edge of aneurism, pulses bouncing at his temples. The viewer almost expects to be drenched in spittle through the screen.
The last four episodes of the final series collectively reveal more about the workings of politicians and the press than the Chilcott and Leveson inquiries together. Tucker's engineering of a coup to remove Murray – while she is on a train and deputy spin doctor Ollie Reeder (Chris Addison) is recovering from an appendectomy – is a farce as accomplished as the Yes, Prime Minister episode in which Nigel Hawthorne's Sir Humphrey Appleby is frozen out of No 10.
That show, though, never had an edition as structurally and stylistically daring as the extended episode six of this year's season of The Thick of It, which consisted entirely of evidence to Goolding.
In a strongly formatted TV show, it is always a cunning move suddenly to show the characters from a new perspective: such as the edition of M*A*S*H that purported to be a TV documentary or the final episode of The Office, in which the documentary template slips from fly-on-wall to where-are-they-now? The Goolding edition of The Thick of It brilliantly played this trick by placing characters used to dominating scenes – especially Tucker and Mannion – in a submissive position. The underlying joke – natural liars and dissemblers struggling under the yoke of an oath – was savage, and had obvious resonances.
In these scenes, the acting and writing attained new levels of concentration. Front's Murray excruciatingly discovers that no one has to laugh at her jokes any more once she is out of office. And, while the scripts are rightly celebrated for Tucker's spectacular invective, the scenes of his downfall cleverly took him beyond savage epigram to a surreal near-inarticulacy: "He's Humpty Numpty … sat on top of a collapsing wall like some … fucking … clueless egg cunt."
There are also tiny, glancing subtleties, such as the quasi-legal speech that afflicts tribunal witnesses. After telling Goolding that he can't "speak to" a certain subject, Mannion aide Phil Smith (Will Smith) goes on to say "I can't remember to that" and "I cannot say to that".
All we can say to The Thick of It is: come back, we need you. As the theoretically real coalition gets closer to the next election, it will increasingly resemble an edition of The Thick of It – but where are they going to get their ideas from once Ianucci's show has gone?
Series 1-4 and the specials of The Thick of It are available in various combinations on DVD.
• This article was amended on 22 December 2012. The original mistakenly referred to Roger Allam's character as, Tom, not Peter Mannion. This has been corrected