Citing a diagnosis of dementia probably related to Alzheimer’s disease, retired Supreme Court justice Sandra Day O’Connor on Tuesday announced her departure from public life at age 88.


It was a poignant exit for a woman who once ranked as the most powerful federal official of her gender in America. Given Hillary Clinton’s defeat in 2016, O’Connor may still qualify as the most powerful woman in the history of U.S. government.


The sources of this power were various, beyond her prestige as the first female justice, and beyond the simple fact that she wielded one of nine votes on the highest court in the land.


She had a suffer-no-fools attitude that could devastate any lawyer who might attempt to mince words with her at oral argument.


As The Post’s Supreme Court reporter, I got a taste of O’Connor’s steel in 2003, when I tried to steer an interview to a subject that seemed newsier, to me, than the topic she had agreed to discuss, the book she had recently published.


“I thought we were here to talk about this,” O’Connor said, unforgettably glaring at me and drumming her index finger three times, hard, on the cover of her book. Tap. Tap. Tap.


O’Connor’s chief strategic asset, though, was her steadfast refusal to succumb to polarization on a court often divided between right and left. “If indeed the choice is between adopting a balanced case-by-case approach that takes into consideration the values underlying the Bill of Rights, as well as the history of a particular … law, and adopting a rigid rule that destroys everything in its path, I will choose the former,” she wrote in a 2004 case.


O’Connor’s flexibility and incrementalism reflected not indecision but a deep belief that it was the most sustainable approach for a far-flung, diverse nation.


Consequently, in case after 5-to-4 case, hers was no ordinary vote but the majority-making “swing” vote, putting her in control of the most politically sensitive areas of law: abortion, affirmative action, religious freedom.


By the time she announced her retirement in 2005, O’Connor had shaped a body of constitutional interpretation that was not necessarily what the conservative president, Ronald Reagan, who appointed her in 1981, would have dictated, but it was remarkably consistent with what was then a broad middle swathe of public opinion.


The states, she had ruled, were protected against excessive federal power, except when Congress acts to defend overriding values such as gender equality. Race-based affirmative action should be viewed skeptically, though it could be permitted for the sake of diversity in higher education. Women have a right to choose an abortion, though not necessarily in every circumstance.


Obviously, her experiences of gender discrimination as a young Stanford Law School graduate during the 1950s shaped O’Connor’s decision-making on the court. As formative, if not more, were her experiences handling ordinary people’s ordinary problems, first as a boomtown lawyer in a Phoenix strip-mall office during the late 1950s and later as a Republican state legislator during the 1970s.


And above all, there was growing up on the Lazy B, her parents’ high-desert cattle ranch. Life there was a string of lessons in problem-solving: caring for sick animals without a veterinarian; heating water using only the sun’s rays; staying amused and entertained with no television and no playmates except for ranch hands, horses and the occasional bobcat.


“The value system we learned was simple and unsophisticated and the product of necessity,” O’Connor wrote in her memoir, “Lazy B.” “What counted was competence and the ability to do whatever was required to maintain the ranch operation in good working order… . Personal qualities of honesty, dependability, competence, and good humor were valued most.”


Those were the qualities she brought to the court, enabling the justices to decide explosive issues when they had to and to finesse them when they did not.


Even now, many liberals can’t forgive O’Connor for casting the fifth vote that ended the recount of Florida’s votes in the 2000 presidential election, effectively making Republican George W. Bush the winner of a bitterly disputed contest with Democrat Al Gore. By the same token, many conservatives gnash their teeth at the fact that O’Connor, a lifelong Republican, balked at overturning Roe v. Wade and abolishing affirmative action.


To be sure, O’Connor’s opinions were not the most elegant, or consistent, in terms of legal doctrine. What her critics fail to appreciate, though, is the courage it often took to stick to her sense of practical wisdom amid the increasingly divisive politics of her time.


America is a lot like the Lazy B ranch: It needs competent, dependable custodians to keep it in good working order.


For roughly a quarter-century on the Supreme Court, that was the kind of leadership Sandra Day O’Connor tried to supply. For the most part, she succeeded.


Charles Lane is a columnist with The Washington Post.