Maintaining family relationships is hard enough; it's harder when the family members in question are kings and emperors and power politics enters the equation; and it's even worse when not only are the royal family members all supposed to get on, but also their relationships are supposed to yield political benefits too.

Queen Victoria, however, believed this was exactly what royal relationships should do. She was convinced that intermarriage between European royalty could be the means by which Europe would achieve lasting peace – and that this would ensure the survival of royalty in the face of the fiendish and increasingly threatening forces of republicanism. She was a compulsive, often dreadfully insensitive, matchmaker for her children and 40-odd grandchildren. By the mid-1890s, her web of marriages had ensured that her grandson George – the future George V – was related by blood or marriage to virtually every royal family in Europe.

Most significantly, George was first cousin to Kaiser Wilhelm II of Germany (whose mother was the Queen's eldest daughter) and first cousin to Tsar Nicholas II of Russia (whose mother was sister to George's mother). But the entanglement of politics and personal relationships placed terrible pressure on both, and when things went wrong, the consequences were often darkly comic and disastrous.

Things went badly wrong, for example, between Kaiser Wilhelm and his English relations – Queen Victoria, whose oldest grandson he was and who regarded him with a mixture of indulgence and exasperation, his uncle Edward VII and cousin George. Personally, Wilhelm was difficult enough. He was spoilt, wilful, bombastic and had the attention span of a gnat. He was riven with insecurities – in particular towards his English family – which made him desperate always to be in the right, easily hurt and vindictive. Told incessantly by his English mother that everything British was better than anything German, he had grown up confused and obsessed by, and resentful of, his English cousins and Britain itself.

What made it extra difficult was that Wilhelm had enthusiastically adopted his grandmother's ideas about mixing personal relations and politics. From the moment he became German emperor in 1888, he wanted to be a force in international affairs and decided that the way to do it was through "personal diplomacy" – his relationships with other monarchs. He was convinced that he had a talent for persuasion. The opposite was true. Within three months of coming to the throne in 1888, he had his uncle Edward publicly evicted from Vienna, then later claimed the episode had never taken place and refused to apologise.

Wilhelm was horribly jealous of Edward, who was hugely popular in Europe, and longed for his attention: a disgruntled German courtier wrote that he "fluttered" round "fat" Edward "like a leaf in the wind round a tower". Edward, meanwhile, had been deeply stung by being publicly humiliated by a nephew 20 years his junior. The two countries' foreign ministries laboured to make sure that the falling-out didn't have wider political consequences, and eventually the family made up. But then they fell out again and again, largely because of Wilhelm's insistence on confusing the powerless British royals with the British government.

Tactless and aggressive public speeches, clumsy interventions in imperial politics, a stream of what Edward called "pinpricks from Berlin", and finally the building of a navy that Wilhelm explicitly admitted he planned should rival the Royal Navy, gradually alienated his increasingly irritated grandmother and fed into the wider political climate, in which Germany and Britain saw each other as international rivals. Even his cousin George, who didn't dislike Wilhelm and was almost completely disengaged from politics, began to complain about the Germans.

Wilhelm didn't create the animosity that built up between Britain and Germany, but his fatal inability to detach the personal from the political meant that over and over he helped to nurture and encourage German hostility towards Britain, while telling himself he was doing the opposite. And his adolescent touchiness and almost oedipal desire to outdo the British, made him a kind of human incarnation of the adolescent German nation's touchiness and overweening desire to measure up to Britain too.

When Edward VII came to the throne in 1901 everything went really wrong. The two men tried to get on, but they could hardly bear to be in each other's company, and Wilhelm, as ever confusing appearances with real power, became obsessed with the notion that Edward was deliberately working to encircle Germany in a web of alliances, starting with the entente cordiale with France. Every setback to German plans was blamed on Edward: "He is a Satan, you can hardly believe what a Satan he is!" Wilhelm told his entourage in the midst of a hysterical rant in 1906. In Britain, Edward placed himself publicly in the British camp that wanted more expenditure on warships and viewed Germany as an explicit threat.

By contrast, George and his family's relationship with his other cousin, Nicholas II of Russia, was genuinely warm. The irony was that the two boys had become friends despite Queen Victoria, who along with the British public had regarded Russia as Britain's chief enemy since the Crimean war – the Russians obligingly hated the British right back. It was the boys' mothers – daughters of the Danish king who had married, respectively, the future Edward VII and the future Russian tsar – who brought them together for holidays in Denmark.

George and Nicholas, both shy, solitary, country-loving and dominated by their mothers, became friends. They also looked eerily like each other, and were often mistaken for each other. "I look upon you ... as one of my oldest and best friends," George wrote to Nicholas in 1894. The key to their relationship was that Nicholas had been raised to make a careful distinction between "Dear Georgie", Uncle Bertie and "Granny" – as Queen Victoria eventually told him to call her – and the nefarious British government and its attempts to grab bits of Asia that were rightfully Russia's; and George was more interested in stamp collecting and shooting than politics.

It wasn't until 1894 that Queen Victoria came round to the idea of being friends with the Russians. Nicholas married her favourite granddaughter, Alexandra of Hesse-Darmstadt. The previous year he had come to London for George's wedding and had completely won over the queen, who thought he was "charming" (he described her as a "big round ball on wobbly legs"). She began to think of what a friendly Russian tsar might do for Britain: reining in French aggression towards Britain, no longer being a threat in Asia, her attitude (though not the British public's) towards the Russian royals transformed.

At Nicholas's coronation feast in 1896, thousands died in a stampede due to the government's criminal lack of organisation. Where once she would have denounced it as typically corrupt and brutal, the queen now worried about the effects on "poor dear Nicky and Alicky". Nicholas, however, was more equivocal towards the British. "Politics alas! are not guided by personal … feelings," he told the queen in 1896. But even he began to get caught up in the family dynamic. During the Boer war he toyed with several plans to disrupt British interests in Asia. Whether they didn't take place because Nicholas had promised "Granny" he wouldn't exploit the situation or because of the disastrous state of Russia's finances, he probably couldn't have said.

At the same time, Wilhelm seemed determined to alienate both sets of cousins. To Nicholas, who was, through several family unions, both a second and third cousin, he wrote condescending, clumsy letters, trying to egg him on to attack India, or fight the Japanese, or hate the British. Nicholas resented being pushed around. When he failed to respond positively, Wilhelm would get angry and encourage anti-Russian elements in his government.

Meanwhile, the near bankruptcy of Russia after the 1905 revolution meant that Nicholas felt there was no option but to make a deal with Britain – a deal in which the British royals played no role, but which they went out of their way to publicly support, meeting Nicholas on their yachts for extravagant celebrations in the Baltic and on the Isle of Wight in 1908 – much to Wilhelm's resentment.

By the time George came to the throne in 1910, the relationship between the British and German royal houses had so cooled that nothing as fragile as personal feelings could have dislodged it. By the time the war came, national political and family affiliations paralleled each other: Britain and Russia against Germany. When George, Nicholas and Wilhelm met for the last time at the wedding of Wilhelm's daughter in 1913, the meeting was a paradigm of the state of international relations. George and Nicholas tried to grab private moments to talk, while Wilhelm did his best to stop them, convinced that they were politicking. Actually, there was almost nothing the two men wanted less.

Then, when the first world war broke out in 1914, Wilhelm – as preoccupied with the British as ever – scribbled over-excitedly, "The dead Edward is stronger than I who am still alive ... " And at the end of the war, arriving in Holland, where he would pass the next 23 years in exile, the first thing he asked for was a "cup of good, hot real English tea". George refused any further contact with him.

Nicholas and George's friendship, too, was no match for the shoals of politics. When Nicholas abdicated in 1917, the provisional Russian government asked the British to give the tsar and his family political asylum. The British government initially said yes, but George – who had told Nicholas a few years before, "Remember, you can always count on me as your friend" – was convinced that if his now deeply unpopular cousin came to England, his own position would be threatened. It was the first time his friendship with Nicholas had been genuinely tested; he responded by lobbying energetically for the invitation to be withdrawn, and it was. Whether the imperial family could actually have been spirited out of Russia is unknown, but George's reaction was a negation of all the decades of protestations of family closeness. Nicholas and his family were murdered at Ekaterinburg 18 months later. George never admitted to playing any role in his cousin's death, but in pictures after the war he always looked worn and haunted. For all three men, family ties turned out to be illusory and destructive.

The Three Emperors by Miranda Carter is published by Fig Tree, priced £25. To order a copy for £23 with free UK p&p, go to theguardian.com/bookshop or call 0330 333 6846. Carter will be appearing at the Woodstock and SW11 literary festivals on 19 and 22 September