With election season upon us and polling data showing that affordable health care remains a top voter concern, President Biden and former President Donald Trump, his presumptive opponent, are both taking credit for capping insulin prices.

The back-and-forth began when Fox News’ John Roberts stated that then-President Trump had signed an executive order in 2020 to lower the price of insulin to $35 a month. Biden-Harris HQ called the statement “a blatant lie,” insisting that “Trump did not cap insulin costs, President Biden did for seniors through the Inflation Reduction Act.”

Mr. Trump struck back on Truth Social, claiming that “Low INSULIN PRICING was gotten for millions of Americans by me, and the Trump Administration, not by ... Joe Biden. He had NOTHING to do with it.”

So who deserves credit: Mr. Biden or Mr. Trump?

The answer is, neither. Rather, Walmart deserves most of the credit.

Mr. Trump’s 2020 Executive Order 13937 would have capped out-of-pocket insulin prices at $35 per month. But the executive order applied only to individuals enrolled in some 1,700 Medicare Part-D prescription drug plans administered through a small group of health services centers. Of the more than 18 million Medicare beneficiaries with diabetes, 8 million, at most, would have been affected.

The executive order, however, wasn’t scheduled to take effect until January 2021. By then, the Trump administration was history. Mr. Biden could have allowed the order to stand, but he balked.

The story doesn’t end there. In August 2022, Mr. Biden signed the mammoth catchall spending bill known as the Inflation Reduction Act, which, according to a Department of Health and Human Services summary, capped out-of-pocket insulin spending “at $35 per month’s supply of each insulin product covered under a Medicare Part D plan, with similar limits for out-of-pocket costs for insulin supplied under [Medicare] Part B.” The caps went into effect in January and July 2023, respectively.

So, the basic facts are these: If Mr. Biden hadn’t short-circuited the Trump executive order, many older Americans would have seen their insulin costs capped at $35 a month starting in January 2021, some 3½ years ago. Under the so-called Inflation Reduction Act, more seniors became eligible for price-controlled insulin in January and July of last year.

But there’s also an important backstory, which involves two political falsehoods: First, that large numbers of diabetics were paying outrageously high prices for needed insulin, and second, that the solution to this (largely nonexistent) “life-and-death” problem required Washington to step in and save the day.

Mr. Biden described his heroics at a campaign event this past spring: “It [insulin] was costing 400 bucks a month on average. It now costs $35 a month.” But as fact-checkers at PolitiFact pointed out, “One government estimate for out-of-pocket insulin costs found that people with diabetes enrolled in Medicare or private insurance paid an average of $452 a year—not a month.”

Even the HHS summary touting the Inflation Reduction Act insulin provisions conceded that there was no cost crisis: “Nationally,” HHS says, “the average out-of-pocket cost was $58 per insulin fill.”

This is where Walmart enters the picture.

The ubiquitous retailer has sold inexpensive products for people with diabetes, including its house brand insulin, ReliOn (manufactured by Novo Nordisk), for over 20 years. One formulation still costs less than $25 a vial.

This and other older insulins lack many features that more modern insulin products provide, but they are effective for many diabetics and have helped keep the price of newer insulins in check—as did the arrival, in 2019, of Eli Lilly’s Lispro, a generic insulin. Several other generics are also available.

Millions of Americans with diabetes had access to reasonably priced insulin without presidential grandstanding.

Though $35 a vial may be less than many were paying, there’s a hidden cost in what Mr. Trump attempted and Mr. Biden achieved: When politicians dictate prices, whether for a vial of insulin or any other product, economic liberty and the competitive market economy are eroded.

The best way to control prices is by encouraging competition and consumer choice. Mr. Biden and Mr. Trump are fighting to get credit for something that never should have been done.