Sophia reached forty still living as her mother's companion. Royal rank had given her palaces and portraits. It had given her very little say in when she could leave.

She was born on 3 November 1777 at Buckingham House in London, the fifth daughter and twelfth child of George III and Queen Charlotte. Her mother was thirty-three. There would eventually be fifteen children in the family, six of them daughters, and Sophia grew up among sisters whose lives would be shaped by the same difficulty: their parents were much happier to keep them than to let them go.

That did not mean a childhood without affection. George was a devoted father, and Kew was the family's retreat from public life, where the royal children played cricket and football in the gardens. There was music too, with George playing the flute and Charlotte the harpsichord, and weekly concerts in the royal residences. Before Kew became associated with the king's illness, it was somewhere his children could play.

Sophia's education was overseen by Lady Charlotte Finch, the governess her pupils called Lady Cha. Under her supervision the princesses learnt English and French, music, drawing and geography, alongside needlework. Her teaching equipment included a mahogany cabinet of dissected maps, early jigsaw puzzles through which the children could learn the shapes and borders of countries. They were being taught about a world considerably larger than the one they would be allowed to move through.

In September 1782, Gainsborough painted Sophia's portrait. She was four, a few weeks short of her fifth birthday. The small oval survives in the Royal Collection. It shows a little girl, not a warning: the family illnesses and the long years as her mother's companion had not happened yet.

The crisis of 1788 and 1789 came when Sophia was about eleven. Her father's severe illness brought doctors, separation and fear into the family, and raised the question of who would govern if he could not. The summer retreat became a place of treatment. George recovered from that episode, but further illnesses followed in 1801 and 1804, and from 1810 his final illness continued for the rest of his life. For his daughters, growing up meant living around a father's condition that could improve without ever being safely over.

Charlotte kept the princesses close. There were few visitors, and the daughters gave their secluded household a name of their own: the nunnery. George disliked the prospect of sending them abroad to marry foreign princes, and the parental reluctance to arrange marriages left the sisters with few ways of establishing homes of their own. Being wanted at home could become a considerable obstacle to leaving it.

Sophia made her court debut in June 1792, aged fourteen. She could appear at court without acquiring much freedom beyond it. Her unmarried sisters remained her companions, and their mother remained the centre of their daily lives. The passage from schoolroom to court did not carry Sophia into an independent household.

Yet the people who supervised that childhood were also people she loved. That October, worried about Lady Charlotte Finch's health, Sophia wrote, "I am grieved to death about her," adding, "she is if possible more kind to us than ever." The girl writing that letter was still fourteen. Affection and restriction belonged to the same upbringing.

By the summer of 1800, Sophia was twenty-two, and she was reported to have given birth to a son. Many historians accept that she did, though some have doubted it. The father is usually named as her father's equerry, Major General Thomas Garth, who was said to have brought the boy up himself. Gossip at the time offered other names, and none of it was ever proved. Nothing was acknowledged. The princess whose ordinary social life was so tightly kept had become the subject of a story about a concealed one.

In 1812, Sophia wrote to her brother, the Prince Regent, thanking him for his kindness to the "four old cats" in the nunnery at Windsor. Four princesses were still unmarried and still at home. She was affectionate towards her niece, Princess Charlotte of Wales, and was asked to act as her chaperone. Looking after a younger royal woman gave Sophia more freedom herself. Even then, an opportunity to move beyond her usual circle came attached to a family duty.

Queen Charlotte died in November 1818. Sophia had just turned forty-one. Her mother's death brought a greater measure of independence after years spent as her companion, but it did not end Sophia's dependence on other people. In later life she became increasingly blind, and Sir John Conroy took control of her finances. She lived at Kensington Palace, where another niece, the future Queen Victoria, was growing up.

Sophia died at her home in Kensington on 27 May 1848, aged seventy. She had never married. By then she had been free of her mother's household for almost thirty years, and for the last ten of them she could not see.