ON THE merits, the three-way race in the Democratic primary for attorney general in Maryland is a slam-dunk. State Sen. Brian E. Frosh of Montgomery County, who is among the most admired, intelligent, civil and hardworking lawmakers in Annapolis, should win the nomination in a walk.

Over the course of nearly three decades in the legislature — much of that in leadership roles — he has been the author and driving force behind landmark laws to improve firearm safety, safeguard the environment and protect Maryland consumers. Other lawmakers take cues from Mr. Frosh when it comes to public ethics. Measured by achievements, qualifications and breadth of experience, the other primary candidates, Dels. Jon S. Cardin of Baltimore County and Aisha N. Braveboy of Prince George’s County, are not in Mr. Frosh’s league.

At once self-effacing and substantive, Mr. Frosh has inspired bipartisan respect as a legislator who gets big things done without unduly tooting his own horn. He has shaped and sponsored much of Maryland’s most important environmental legislation for years, including measures to protect the Chesapeake Bay and promote recycling and cleaner cars. He wrote laws that cracked down on identity theft and teen drunk driving and has been one of the Senate’s most effective strategists in tackling gun violence.

That Mr. Frosh is not the heavy favorite can be attributed to two factors: the unpredictability of tiny-turnout elections, as the June 24 primary is expected to be, and that one of his opponents happens to possess a famous name. That would be Mr. Cardin, a lackluster lawmaker whose uncle is U.S. Sen. Benjamin L. Cardin (D-Md.).

The younger Cardin, who has spent 12 years in the House of Delegates, has advanced sensible legislation to punish cyberbullying and revenge porn and to restore voting rights to ex-convicts. But he is no one’s idea of a leader. According to an analysis in the Baltimore Sun, Mr. Cardin skipped almost three-quarters of the 164 votes this year in the House Ways and Means Committee — a dereliction of duty for which he declined even to offer an explanation. He even missed votes on bills he co-sponsored. The truth is, he was not much missed. Were it not for the serendipity of his surname, Mr. Cardin’s candidacy would be ignored.

Ms. Braveboy, leader of the legislative black caucus in Annapolis, is an adroit lawmaker who has pushed legislation to help the disadvantaged and keep wayward children in school. She has good ideas about expanding protections for neighborhoods harmed by foreclosures and empowering parents seeking better schools for their children with learning disabilities. Still, after eight years as a legislator, her candidacy seems quixotic and shows few signs of gaining traction. Compared to recent attorneys general, her achievements in public office are scant.

Just three people have held the job of attorney general of Maryland in 35 years, a turnover rate on par with the top job at the Vatican. The powers vested in the job, while not quite papal, are considerable, particularly in the areas of consumer protection, the environment and civil rights. Alone in this field of candidates, Mr. Frosh has the political savvy, command of policy and stature to be a superb attorney general.