The relationship between the sovereign and the prime minister of the day is supposed to be a private affair, but inevitably snippets have leaked out.
Sir Winston Churchill, her first prime minister, is thought to be her favourite.
He greeted the young, grieving monarch when she arrived back on British soil after her return from Kenya on the death of her father, King George VI.
When Churchill retired in 1955, the Queen sent him a handwritten letter telling him how much she missed him and how no successor “will ever for me be able to hold the place of my first prime minister, to whom both my husband and I owe so much and for whose wise guidance during the early years of my reign I shall always be so profoundly grateful”.
Like a kindly uncle, Churchill had nurtured her through the early years, giving her the sort of advice which no-one else could have done.
The Queen’s relationship with the starchy Sir Anthony Eden was certainly more formal, while Harold Macmillan was an urbane figure, in contrast to the monarch, who is a countrywoman at heart.
However, on one occasion, rather than discussing affairs of state at one of their audiences, the Queen and Mr Macmillan could be seen huddled over a transistor radio as US astronaut John Glenn was hurtling through space.
Sir Alec Douglas-Home reportedly met with royal approval.
An aide said: “He was an old friend. They talked about dogs and shooting together. They were both Scottish landowners, the same sort of people, like old schoolfriends.”
Harold Wilson endeared himself to the Queen. “They got on like a house on fire,” one long-standing member of the Labour Party said.
He also joined members of the royal family for riverside picnics at Balmoral.
However Sir Edward Heath is said to have struggled with small talk and their weekly audiences were described as “frosty”.
James Callaghan managed to establish a warm rapport, and he said about the Queen: “One of the great things about her is that she always seems able to see the funny side of life. All the conversations were very enjoyable.”
But things were different with Baroness Thatcher, who reportedly found the traditional September weekend at the Queen’s Balmoral estate painful.
One observer wrote: “A weekend in the country with aristocrats who enjoy riding, shooting, sports and games is Thatcher’s idea of torture.
“But her dread of the weekend receded as the two women became somewhat more comfortable with one another.”
Baroness Thatcher could not abide the charades that she was expected to play after dinner at Balmoral, and the Queen, at a gathering of six of her prime ministers, once joked about “the party games which some of you have so nobly endured at Balmoral”.
When Baroness Thatcher died in April 2013, the Queen took the unusual step of attending the ceremonial funeral, a personal decision and an indication of the Queen’s respect for her first, and at the time her only, female prime minister.
Sir John Major was popular with the royal family largely because of the genuine concern he expressed for the welfare of the then two young princes, William and Harry, first on the divorce of their parents and then on the death of their mother, Diana, Princess of Wales.
Tony Blair was described in some palace quarters as a “head of state-in-waiting”, and there were courtiers who were not enamoured by what they saw as his encouragement of a “people’s monarchy”.
Neither Mr Blair, who later revealed details of his private conversations with the Queen in his memoirs, nor Gordon Brown, who was reported to have had a good but formal relationship with the royals, were invited to the Duke and Duchess of Cambridge’s wedding in 2011.
A red-faced David Cameron was forced to make a grovelling apology to the Queen in 2014 after his “purr-gate” blunder.
Mr Cameron was caught on camera telling then New York mayor Michael Bloomberg that the Queen had “purred down the line” when he telephoned and told her the result of the Scottish independence referendum.
Theresa May was the second female prime minister of the Queen’s reign, taking up her post in July 2016 in the wake of the Brexit vote, more than a quarter of a century after Mrs Thatcher stood down.
It was reported last week the Queen will be “sad” to see Mrs May step down on Wednesday.