In the mid-19th century, received wisdom had it that the way to ensure goodwill between nations was for their royal families to inter-marry. And so it was that at the outbreak of the first world war, the heads of state of Britain, Russia and Germany were cousins.

Germany's Kaiser Wilhelm II – Queen Victoria's first-born grandchild – was arrogant, posturing, unpredictable and, in the opinion of many who met him, mad. Throughout his life he was torn between a desperate need to be loved by Britain and a fanatical hatred of its power. Tsar Nicholas II, meanwhile, was a deeply indecisive leader, happiest at home with his family, with a court of some 16,000 people (including 200 ladies in waiting for the tsarina) insulating him from the harsh realities of his medieval empire. His detachment and lack of self-awareness meant that when in May 1896 a stampede at a feast in Khodynka to mark his coronation left thousands of his subjects dead, the tsar didn't stay at home to mourn; instead he spent the evening at a ball, and was photographed there drinking champagne.

George V was less reprehensible, but hardly a great figurehead for the largest empire on earth. A shy, dull man who had no wish to succeed his extrovert father, Edward VII, he enjoyed shooting but had painfully little interest in the outside world (Harold Nicolson, a previous biographer, wrote: "For 17 years he did nothing at all but kill animals and stick in stamps").

Miranda Carter paints a superb picture of the three cousins and their intertwining lives, from their strict, isolated and at times deeply unhappy upbringings, to the war that ended with two of them brutally deposed. As the increasing suspicions and tensions between the great powers lead to an arms race and then inexorably to war, she offers a fascinating and frequently darkly funny account of the interactions between the three – and between the monarchs and their long-suffering ministers.

Quoting extensively from their correspondence, Carter exposes Wilhelm's deep insecurities and reveals the strong friendship between George and "Nicky", which makes perhaps the most damning revelation about the British king all the more shocking. In 1917, with Nicholas having been forced to abdicate and placed under house arrest, George refused the Romanovs sanctuary in the UK, fearing their unpopularity might prove catastrophic for him.

At least George did learn from the fate of his cousins (Wilhelm had been effectively sidelined by his generals and was later exiled). He saw that for the royal family to survive it had to adapt; today's decorative, ceremonial monarchy is the legacy of that realisation.