With strong soak-the-rich rhetoric, Elizabeth Warren has surged in polls for the Democratic presidential nomination. She claims that “billionaires have seized our government” and that “when you’ve got an economy that’s doing great for those with money and isn’t doing great for everyone else, that’s corruption, pure and simple.” Bernie Sanders is also polling near the top of Democratic field by blasting wealth inequality as “obscene” and denouncing the economy as “rigged” by rich people.

Democrats are right that corruption or cronyism helps drive wealth inequality. Well-heeled interests do line their pockets from government spending and regulatory policies. Farm subsidies are classic cronyism: More than $20 billion a year in taxpayer money goes mainly to the wealthiest farmers, including even billionaires.

Federal sugar regulations benefit producers by imposing costs on consumers of up to $4 billion a year. The Fanjul family of Florida built an $8 billion fortune in the sugar industry based partly on their political ties to presidents and members of Congress. Such subsidy programs are “wholesale” cronyism. There is also “retail” cronyism, when particular individuals and businesses get rich by abusing the system. In a recent scandal, a Singapore-based tycoon known as “Fat Leonard” Francis cozied up to U.S. Navy leaders in the Pacific to win hundreds of millions of dollars in contracts to resupply Navy ships. He made large profits over many years by overpricing contracts and faking invoices. To steer contracts his way, Francis bribed officials with gifts, prostitutes, and other favors.

Solyndra is another prime example of retail cronyism. The Department of Energy gave the solar-panel maker a $535 million loan guarantee in 2009. The company went bankrupt and taxpayers got hit with the cost. Why did Solyndra get a loan? Because the White House pressed the department to approve it, since the company’s largest investor — billionaire George Kaiser — was a major fundraiser for Barack Obama.

So Warren and Sanders are right about corruption in Washington, which has likely increased over time. The federal government runs 2,300 different subsidy programs today, more than twice as many as in the 1980s. Over the same period, the number of pages of federal regulations has jumped by two-thirds to 180,000. More programs and regulations mean more ways that special interests can line their pockets. And it means more high-paid lobbyists in D.C., which is partly why the region boosts six of the ten highest-income counties in the nation.

But here’s the big mistake that Warren and Sanders make: Their rhetoric suggests that all top fortunes are ill-gotten, and all wealth inequality stem from cronyism. Based on that misguided view, they want to punish all wealthy people with an annual wealth tax — including the many entrepreneurs and philanthropists whose efforts help the poor.

What Warren and Sanders do not understand is that wealth inequality is not good or bad by itself — it entirely depends on what caused it. Inequality may reflect crony capitalism, or it may reflect innovation in a growing economy that is lifting all boats.

On the Forbes 400 list of the richest Americans, you find people such as Brian Acton and Jan Koum. They became billionaires by creating WhatsApp, which provides free phone service for 1.5 billion users globally. Their fortunes may have increased wealth inequality, but their product has produced massive value for consumers.

Acton and Koum are far from unique. Most of the billionaires on the Forbes list are self-made business people who have created real economic value. Most of the top wealth in the United States is earned in competitive industries, not from cronyism. Meanwhile, the share of people on the Forbes list who inherited their wealth has plunged from 60 percent in the 1980s to just 30 percent today. The broad-brush denunciations of wealth by Warren and Sanders would make more sense in countries such as Russia or Venezuela, where cronyism dominates. But the United States ranks as the 22nd least corrupt of 180 countries in Transparency International’s “corruption perceptions index.” And it ranks 25th least corrupt of 213 countries on the World Bank’s “control of corruption index.”

Using the Forbes list of international billionaires, Sutirtha Bagchi and Jan Svejnar separated the bad ones who got rich through political connections from the good ones who did not. Across countries other than the United States, they found that 17 percent were bad and 83 percent were good. But in the United States, just 1 percent were bad and 99 percent were good. By this metric, American billionaires overwhelmingly earned their wealth in productive and non-corrupt ways.

Finally, The Economist created a “crony capitalism index” using the Forbes list to estimate billionaire wealth in each country obtained from crony and non-crony activities. The United States is seventh least corrupt of 22 countries, and U.S. billionaire wealth earned in crony activities is only about one-sixth as large as that earned in non-crony activities. Warren and Sanders are wrong to paint most or all of top U.S. wealth as cronyist.

Nonetheless, there is room for improvement. Cronyism in Washington is an important problem that polls show Americans are very concerned about. The way to attack it is not to punish all wealthy people with damaging new taxes, but to eliminate the subsidies and regulations that fuel it.