On Wednesday evening, when news broke that Boston Mayor Tom Menino won’t run for a sixth term, I was watching preview episodes of “Game of Thrones,” the HBO series that starts its third season tonight. And in my mind, the fictional kingdom of Westeros merged with the real-life story of the mayor-for-life. Somehow I could imagine Menino lounging, in his grandfatherly glory, on a huge Iron Throne of his own.

“Game of Thrones” is about the quest to own that spooky-looking chair. On the surface, the show, with its medieval swordplay and dragons and supernatural wolves, seems as far from Hyde Park as you can get. But the show’s most compelling storylines are about the human beings who are jockeying to rule the kingdom. And for anyone interested in politics, “Game of Thrones” is essential viewing, the best rumination on power that has ever aired on TV.

Leadership in Westeros is brutal business. Armies are amassed, loyalties shift, and nobody says a word that can be taken at face value. It’s enough to make you appreciate our flawed but bloodless democratic system. Still, you can draw some analogies between Westeros and Menino’s Boston. Regular elections notwithstanding, a big-city mayorship is probably as close to a medieval monarchy as any American political position could be. A mayor can amass a political machine that functions as its own sort of army. And a city is self-contained enough to bear the mark of its longtime leader.

For two decades, Menino has managed to shape Boston in his image, as a place where neighborhoods maintain a strong identity, municipal services dominate the priority list, and development meets the strict specifications of City Hall. The City Council provides few checks on the mayor’s power. Menino, unchallenged, has governed almost with an iron fist.

And yet, for someone who lacks traditional political charisma, Menino has generated unfathomable loyalty, both within his Brutalist palace and outside of it. A 74 percent favorability rating isn’t just respect. It’s adoration.

How to build the public’s love is a main theme of “Game of Thrones,” where rulers rely on a fealty so strong that subjects are willing to die for them. Some gain their power through regional and ethnic ties; Robb Stark, an upstart from the northern part of the kingdom, rallies his fellow northerners. Some tap instead into personal qualities; through ruthlessness and some uncommon displays of courage, the teenage princess Daenerys Targaryan wins over a loyal corps of brutish men. (I haven’t read the books on which the series is based, but my money is on her to take it all.)

Menino has done a little bit of everything. He gained early fame as the city’s first Italian-American mayor, but he managed to generate a cult of personality by showing up everywhere: community meetings, restaurant openings, the aftermaths of tragedies. He has projected a love for the city that crosses ethnic boundaries. He hired people who could tap into the desires of neighborhood residents and the demands of the city’s workforce — though he ignored considerable sentiment toward keeping bars open later at night, a situation where two visions of Boston collided.

And by taking some well-chosen, passionate stands, he infused his meat-and-potatoes style of governance with just enough ideological passion to win some constituents’ affection forever. He supported gay marriage, vigorously, long before it became a core Democratic issue. His attack on Chick-fil-A last year was a shining moment, not because he was right in that individual case — he wasn’t — but because he was conscious of the larger battle.

That seems the key to earning power in Westeros and beyond: Stay conscious of your image, through seemingly minor events as well as large ones. In tonight’s “Game of Thrones” episode, a woman who wants to be queen flees her security detail to visit an orphanage in a rough neighborhood. A cutthroat rival is appalled, but also threatened: She knows, in her heart, that the gesture will make a difference.

Menino knew the power of familiarity. He won over Boston because he knew its people, and trusted them to follow him. He also seemed to know to make their affection last forever: Exit on a high, before you get weakened by someone else’s army.