In August 1980 Margaret Thatcher’s first government, barely a year old but already deeply unpopular and bogged down by problems, produced a Housing Act. Even more than most legislation it was prolix and repetitive, but its bold intention stood out: “to give ... the right to buy their homes ... to tenants of local authorities”. It envisaged a revolution in how a large minority of Britons lived.

That revolution – which David Cameron’s government controversially hopes to revive by extending the right to buy to housing association tenants – had been an awfully long time coming. Contrary to the conventional wisdom, cleverly sown by the Conservatives in 1980 and doggedly cultivated by rightwing Britain ever since, selling off council homes was not a sudden stroke of genius by the Thatcher government. The idea was as old as council housing itself.

“Nineteenth-century housing legislation required that council-built dwellings in redevelopment areas should be sold within 10 years of completion,” point out the historians Colin Jones and Alan Murie in their little-known but revelatory 2006 book The Right to Buy. During the 1920s council homes were sold “on a small scale”. During the 50s sales accelerated: 5,825 in May 1956 alone. By 1972 even a distinctly leftish Tory environment secretary, Peter Walker, could declare to his party conference that the ability of council tenants to buy their homes was a “very basic right”, and that they should be offered a 20% discount on the market price. Later in the 1970s, now a backbencher, Walker went further, suggesting that municipal properties should simply be given to their tenants. Michael Heseltine, the Conservative shadow environment secretary from 1976, who was close to Walker and like him had a populist side, agreed.

Labour councils, responding to the squalor and overcrowding of Victorian and Edwardian cities, and the graphic failure of private landlords and developers to deal with it – indeed the glee with which some of them exploited it – had constructed much of Britain’s early municipal housing in the 1900s. Labour councils and governments carried on building it in large quantities for the next seven decades. By the early 70s some Labour local authorities were even buying up whole streets of decaying inner-city properties from private landlords, and turning them into council homes – a tangible and potent demonstration of state power making up for market failure. By 1980 the proportion of all British housing in state hands was “large ... by international standards”, write Jones and Murie, “almost one in three households”. Most Labour politicians believed there were few reasons, electoral or moral, to risk unravelling the housing safety net that made a congested country habitable for tens of millions.

Yet from the mid-70s some influential Labour figures, such as Harold Wilson’s press secretary Joe Haines and Jim Callaghan’s economic adviser Gavyn Davies, began to wonder whether renting from the council, often for life, was a satisfying way for such Britons to be living, and also whether governments could afford to keep building the necessary properties. By the late 70s, the Wilson and then Callaghan administrations were increasingly short of money; and their more forward-thinking members were increasingly interested in the growth of consumerism and private property, and how Labour might adjust to it, before the other parties could take full advantage. Both Labour governments built progressively fewer council homes. In 1977 a high-profile housing study by the Callaghan administration accepted that “for most people, owning one’s house is a basic and natural desire”. The language used by Labour and the Conservatives to talk about the issue was beginning to converge.

Margaret Thatcher after handing over the deeds of the house to the Pattersons of Harold Hill, Essex in 1980. Photograph: PA Archives

At the 1979 general election, council-home sales featured prominently in the Conservative manifesto. In this slim pamphlet, the right to buy was given as much space as enormous issues such as education and health, and explained right down to the precise discounts to be offered to tenants. These were to start at 33% off their home’s market value, and were to rise, according to how long they had rented it, to a maximum of 50% for tenants of 20 years’ standing or longer. “We shall also ensure,” promised the manifesto, “that 100% mortgages are available.” For any purchaser, and particularly for people in late middle age or older, the British age group most likely to vote Conservative, these were extremely generous terms; or as Davies put it to me, half-impressed and half-horrified, “You were insane if you didn’t buy.”

Whether these terms represented a good deal for the state, which had after all built these homes and would lose the rental income from them, was not something the manifesto explored. Nor were related, even more fundamental questions. Would the country be left with enough cheap homes after the sell-off? And would the policy backfire if the population, and therefore the demand for housing, rose? Given that the UK was part of the EU, and also linked by other busy immigration routes to its vast former empire, and to the US, a stable or falling population, as had existed throughout the 1970s – a period of perceived British decline that Thatcher had noisily promised to reverse – could hardly be assumed.

But effectively it was. The right to buy, say Jones and Murie, “was introduced at a time of some complacency in British housing policy ... For the first time in over a century there was not a shortage.”

On winning power, Thatcher made the forceful Heseltine environment secretary. She and the Treasury quickly squashed his notion about giving away council homes. The cash-strapped Treasury needed the money from sales. The prime minister, with her acute sensitivity and loyalty to Tory-inclined social groups, believed, probably with good reason, that a giveaway would enrage homeowners who had painstakingly saved for deposits and paid off mortgages.

Instead, within a fortnight of taking up his post, Heseltine issued an official circular recommending council-home sales. To his frustration the legislation took almost 18 months to draft and push through, with obstinate resistance coming from Labour councils and the House of Lords. But by August 1980 the act was passed. Thatcher herself introduced the policy in a special television broadcast. “If you have been a council tenant for at least three years,” she began, enunciating her words even more slowly and carefully than usual, as if addressing a slightly dim child, “you will have the right, by law, to buy your house.” She gave a couple of firm, no‑going-back nods: “And that’s that.”

“The right to buy”: it was a clever slogan, clear, quick to say, easy to remember, and combining two of modern Britain’s favourite preoccupations, personal freedom and purchasing, while also encapsulating the more seductive side of what the Thatcher government was offering the country. Her use of the word “house” in the broadcast, when millions of council tenants actually lived in flats, was also significant. It gave the policy an aspirational flavour: reassuringly suburban rather than proletarian and urban.

Thatcher used the word ‘house’ in her broadcast when millions of tenants actually lived in flats, giving the policy an aspirational flavour. Photograph: David Bagnall/Rex Shutterstock

The right to buy TV ad that soon followed gave further, less subtle, hints that the government’s intended housing transformation would reinforce rather than upset the existing social hierarchy. In a generous, tidy semi without a tower block in sight, like the setting for a middle-class sitcom, an envelope containing a right to buy leaflet dropped on to the doormat. A small tousled boy, wearing dungarees, white-skinned, picked it up. He ran eagerly to the breakfast table. There, his mother, in her mid-30s, dressed in a spotless white blouse, and with a Lady Diana-like haircut, was reading a newspaper and sipping from a genteel white teacup. The old-fashioned implication seemed to be that father was out at work. The camera moved closer to the table, revealing that mother was poring over a print ad headlined “How to go about buying your council house”. Then a voiceover began in a chirpy cockney accent – the ad’s one concession to the existence of a working class – informing viewers that “There are nearly 5 million council tenants in England and Wales, many with families like yours ... You can decide whether to turn your home into your house.”

Sales started slowly. During the remaining four months of 1980, 55 council homes were bought in England under the new legislation. Some Labour local authorities were deliberately sluggish in dealing with would‑be buyers. In the London borough of Greenwich, council staff refused to give out application forms, and sometimes denied that a right to buy existed at all. But Heseltine, empowered almost without limit by the 1980 Housing Act, beat his municipal opponents in court. Then came the sales surge: in 1981, 66,321 English right to buy purchases; in 1982, 174,697 – a sales peak that would be repeatedly approached during the rest of the 1980s but never exceeded. In Wales, too, sales peaked early, in 1982. In Scotland, people were more cautious, the highest annual figure not reached until 1989. There were also regional variations: in England, sales were fastest in London, the south-east and the south-west, and slowest in the industrial, or increasingly ex‑industrial, north.

But certain patterns were universal. Semis sold better than terraces. Houses sold better than flats – at first by almost 50 to one. Low-rise flats sold better than high-rise ones. Properties with gardens or garages were strongly in demand. Rural and suburban properties sold better than urban ones. Homes on small estates sold better than homes on large ones. Homes with non-council neighbours were the most sought after of all.

Similar subtle and not so subtle social gradations defined the buyers. A thorough, politically neutral national survey conducted by the Department of the Environment in 1985–6 and published in 1988, looking back at the first five years of the right to buy, found that: “[Purchasers] were a highly diverse group but ... clearly not representative of [council] tenants as a whole. Buyers were disproportionately drawn from the middle-aged and the better-off, many with adult children sharing the home and the expenses. Most were in full-time work, usually manual skilled or white-collar occupations, and with more than one wage-earner in the household. Buyer incomes were on average about double tenant incomes.”

Michael Heseltine was frustrated by opposition to the Housing Act 1980. Photograph: Richard Francis/Rex Shutterstock

Buyers were 10 times less likely to be unemployed than non-buyers. And they were twice as likely to know existing homeowners. In fact, “Two thirds of buyers reported that all or most of their family or friends were owner-occupiers.” In all these regards, the survey quietly concluded, council-home buyers in the first half of the 1980s showed a strong “continuance” with those who had bought council properties during the decades before the right to buy became law.

Thatcherism, in some ways, was a highly skilful exercise in feigned egalitarianism – as indeed is capitalism itself. Right to buy, for all its appealingly inclusive rhetoric, was not a right available to all. Those who could not afford to exercise it tended to be lone parents, younger tenants, people living on their own, or Thatcherism’s economic losers: the unemployed or low-skilled.

There were also psychological barriers. Non-buyers tended to be afraid of mortgage debt, or of taking responsibility for repairs. Or they didn’t think property ownership was for the likes of them. Or they simply didn’t like their home enough to buy it: during the 70s, more vulnerable tenants had become increasingly concentrated in the worst council properties. Often, non-buyers were simply too overwhelmed by the rest of their lives. Even after five years of the right to buy, the 1988 report found, almost a tenth of council tenants were completely unaware of the scheme at all. Among the remaining nine-tenths, the vast majority of whom qualified for it, “knowledge of the right to buy was found to be sparse and often inaccurate”.

The government and its press allies presented the right to buy as a triumph regardless. Either way, the scheme did succeed in altering how many Britons thought. The 1988 survey asked 1,230 buyers why they had bought, and received hard-headed, individualistic, essentially Thatcherite responses: “good financial investment ... the ‘bargain’ which discounts on sales provided ... the sense of security ... of pride ... the freedom to repair or improve ... the desire to have something to leave the family ... to move up the housing ladder ... to increase mobility”. Two-thirds of those questioned said they had not expected to become homeowners until the right to buy legislation. As in all successful capitalism, a new demand had been created and then satisfied.

The discounts were pivotal to the process. The official prices of the state assets being sold off were respectably high: in southern England in 1981 the average valuation of a right to buy property was £19,557, a tenth more than the average price paid for a private-sector home by an English first-time buyer. Yet most right to buy purchasers actually paid much closer to £10,000: “The average discount obtained” nationally, reported the 1988 survey, “was 44%.” Buyers typically borrowed almost the entire cost of their property. Meanwhile the government received a financial windfall, not as juicy as North Sea oil, but substantial: £692m from council-home sales in 1980–1, £1.394bn in 1981–2, £1.981bn in 1982–3.

Thatcherism liked to present itself as a rejection of the postwar, state-driven, more profligate way of doing things. But in housing, her administration was actually the postwar state’s beneficiary, selling off the assets it had built up. A similar dependency lay, almost never acknowledged, behind her social and economic reforms generally. Her freedom to make Britain more risk-taking and individualistic in some ways only existed because the country she had inherited, for all its flaws and tensions, was a relatively stable, unified place underneath: more equal in the late 70s than it had ever been, still permeated by shared class assumptions and largely at peace – there had been few riots in Callaghan’s Britain. Her administration, supposedly dynamic and new, in fact partly lived off this social capital that stodgy old social democracy had produced. What would happen when that social capital began to run out, like what would happen when Britain ran out of cheap housing, was, in the early 1980s, a question for another day.

Unusually among Thatcher’s ministers, Heseltine had some sensitivity to the wider consequences for housing of right to buy. He successfully argued that councils should be allowed to keep three-quarters of the income from sales, in order to replace the homes sold. Contrary to right to buy’s small but growing number of critics since the 80s, the policy did not kill council home-building overnight: more than 250,000 state-owned dwellings were completed between 1980 and 1985.

But the rate of construction did slow, year by year. The share of the income from sales that went to councils was gradually eroded, against Heseltine’s wishes. In 1983 Thatcher moved him to the Ministry of Defence, in large part to use his bulldozing charisma against CND and the women of Greenham Common.

Meanwhile rents for remaining council tenants rose with a new alacrity. By 1991 they were 55% higher, relative to average earnings, than they had been 10 years earlier. “If it were not for the right to buy,” conclude Jones and Murie, “the council housing sector as a whole would have generated huge surpluses [from rental income] and the rise in real rents ... would not have been necessary.” Or to put it more directly: home ownership was made possible for wealthier council tenants through discounts paid for by their poorer neighbours.

Yet in the early 1980s, the full cost of the right to buy was less apparent than the new front doors, new kitchens and bathrooms, new paint jobs and fireplaces, new pebbledash and stonecladding, new garden balustrades and double glazing, new porches, conservatories and mock-Tudor panels that began to appear across the previously muted and communal landscape of British municipal housing. The prime minister posed regularly with new owners, in their lovingly arranged kitchens, on their swept-clean doorsteps, in their trimmed front gardens; the owners usually a little younger than the average buyer, and dressed up for the occasion, with photogenic children at hand. Thatcher herself looked genuinely fascinated and delighted, sometimes even sitting on a garden wall – winning one of her battles to reshape the country, for once. Until the spring of 1982, and the improbable rescue of her reputation and popularity by the Falklands war, it did not seem likely that she would win many more.

• This is an extract from Promised You A Miracle: UK80-82 by Andy Beckett, to be published by Penguin on 3 September. To order a copy for £16 (RRP £20) go to bookshop.theguardian.com or call 0330 333 6846. Free UK p&p over £10, online orders only. Phone orders min p&p of £1.99.