Kings, queens, and emperors have ruled over nations for 5,000 years. How have they adapted to the 21st century? Here's everything you need to know:

How many monarchies remain?
About 30, reigning over some 45 countries. The British monarchy, which dates to the 11th century's William the Conqueror, technically rules over 16 countries, including Canada and Australia. The current head of the British royal family, Queen Elizabeth II, ascended to the throne in 1952. She mostly fulfills a ceremonial role, as she did last week when hosting President Trump during his state visit to the U.K. Five of the world's monarchs — Cambodia's, Malaysia's, Samoa's, Andorra's, and the Vatican's — are "elected," meaning that they are chosen by a council of leaders, rather than inheriting their roles. Five modern monarchs have absolute power, ruling over Saudi Arabia, Qatar, Oman, Swaziland, and Brunei. Ten remaining European monarchies are hereditary; all of their current heads are distantly related. Their last common ancestor was John William Friso, Prince of Orange, who died in 1711. Only one world monarch — Japan's — enjoys the title "emperor."

Who is Japan's emperor?
There has been a recent change in that position. After having two surgeries, His Majesty Emperor Akihito, then 82, told his nation in 2016 that he wanted to retire. The first emperor to abdicate the Chrysanthemum Throne since 1817, he needed the National Diet to provide a dispensation from the law requiring he die in office. Six weeks ago, Akihito formally stepped down in a ceremony steeped in ritual, rising at dawn to inform the Shinto sun goddess, from whom his line originated in myth 2,600 years ago. He returned the "three sacred treasures" — a mirror, a sword, and a jewel — that symbolize the throne. Though Akihito was succeeded by his son, the Oxford-educated Naruhito, his return of those treasures was widely interpreted as a symbolic statement that the monarchy would change as it moved into the modern era. When he announced he was abdicating, Akihito said he was thinking "about how the Japanese Imperial Family can put its traditions to good use in the present age and be an active and inherent part of society."

Are there fewer monarchies?
Yes, dozens have been swept away by war and the great political movements of the 20th century: nationalism, anti-colonialism, republicanism, and Marxism. In 1900, most of the world — and almost all of the Eastern Hemisphere — was under the control of monarchs with real power. After the cataclysm of World War I, the Russian, German, Austro-Hungarian, and Ottoman Turkish crowns vanished. World War II and the postwar rise of Communism's "Iron Curtain" ended many more. Not all kings went voluntarily. King Michael I of Romania was forced to abdicate in 1947 after resisting strong pressure from the Communists who controlled the country. He finally gave in when Prime Minister Petru Groza invited him to feel his jacket pocket. "He had a pistol," the king later recalled. "I had no choice."

When did monarchies begin?
The earliest dates to around 3100 B.C., to the pharaohs of Egypt. In 2750 B.C., monarchs believed to be at least partly divine ruled over Sumeria (now modern-day Iraq). In the 1st century B.C., emperors came to rule over the Roman Empire and continued to do so for centuries. After the collapse of that empire, kings began to rise throughout Europe from the ranks of wealthy landowners, who appointed vassals to act as managers of a particular region. As early as the 7th century A.D., the Anglo-Saxon kings of England claimed to rule by divine right; to disobey them was to disobey God. "The state of monarchy is the supremest thing upon Earth," King James I said in a speech to Parliament in 1610, "for kings are not only God's lieutenants upon Earth and sit upon God's throne, but even by God himself they are called gods."

How do monarchs survive today?
Most modern monarchies are constitutional: While the monarch is still the official head of state, the constitution imbues an elected legislature with actual power and the duties of government. The monarch holds a symbolic role intended to provide an unbroken link to the past and a sense of national pride and unity among a country's populace. Today's royals, however, not only have far less political power than their forebears, they also live more modern lives. Akihito, for example, was the first Japanese emperor to marry a commoner. Dutch King Willem-Alexander revealed in 2017 that he'd secretly been co-piloting Dutch Royal Airline flights for 21 years. "You cannot take your problems from the ground skyward," he explained. "You can completely switch yourself off and focus on something else. That's the greatest relaxation for me."

Will monarchies last?
Most seem to be on a strong footing. In the Middle East, the absolute monarchs have been able to buy public acquiescence — and the support of powerful allies such as the U.S. and Britain — by controlling their countries' mammoth oil revenues. But even in more modern and democratic societies, monarchies remain popular with the public. "Presidents come and go," said Kenneth W. Gunn-Walberg, head of the International Monarchist League's chapter for the Eastern U.S. "There's continuity, a sense of history with a monarchy."

More than mere figureheads
Despite seeming to be anachronisms, most monarchies actually provide effective governance, according to Wharton School of Business management professor Mauro Guillen. He studied 137 countries from 1900 to 2010 and found that monarchies — especially constitutional ones — generally provide a higher standard of living and are better at protecting property rights than even republics. Monarchies are usually dynastic, he said, and thus likely to "focus on the long run," protecting the foundations of society and curbing potential abuses of power. And even though many of today's kings and queens are figureheads, monarchies act as a check on the egos of elected chief executives. "If you're the prime minister and you know there is a higher authority," Guillen said, "you are a bit more subdued." Finally, monarchies are better at navigating periods of uncertainty, because they provide a stable connection to a nation's history — as the British monarchy is now doing amid Brexit turmoil.