Donald Trump, today, became the poster child for transactional philanthropy: Even when he spends other people’s money, or makes a charitable donation in his own name, he’s always buying something.

What Trump did with the Donald J. Trump Foundation was illegal, both according to the New York attorney general, who filed a lawsuit Thursday against the foundation, Donalds Sr. and Jr., Ivanka, and Eric Trump, and according to basic common sense. If you’re getting something in return, it’s not charity, it’s a deal. The law goes to great lengths to draw a line in the sand, to say that when you’re self-dealing, or really making a purchase rather than a donation, then that’s not a charitable activity. Donald Trump completely ignored that line and indeed went so far across it that it was barely even visible anymore.

That line, between a donation and a purchase, is not always obvious. If you walk into a local store and buy a tote bag, that’s a purchase. But if you give money to your local public-radio station and receive a tote bag, what’s that? When you spend $200 a head on a fancy meal from a celebrity chef, that’s a purchase. But when you spend $2,000 a head on the same meal at a gala dinner, what’s that? If a company spends tens of millions of dollars to put its name on a sports stadium, that’s a purchase. But if an individual spends tens of millions of dollars to put his name on a hospital, or a concert hall, what’s that? Philanthropy has increasingly adopted what fundraising consultant Larry Raff calls a “purchase and sale mentality,” which of course is entirely natural for someone with the zero-sum worldview of Donald Trump. When Trump spends money, he always wants to get back, in return, more than he spent. That’s true regardless of which arm of the Trump Organization has its name on the bottom of the check he’s signing, even when that arm is the Trump Foundation.

In Trump’s mind, the Trump Foundation was never really a charitable foundation. Instead, it was little more than a money-laundering machine.

What Trump did, however, was not in any of those legal gray zones. Most people understand this. If you spend $2,000 at a gala dinner, you don’t deduct the full amount; you can only deduct the amount greater than the value of the dinner consumed. If you donate a painting to a charity auction, you can deduct the value of the painting; if you buy a painting at a charity auction, however, that’s a purchase, for which you can’t use tax-exempt funds.

Donald Trump ignored all those distinctions, and Thursday’s complaint has countless examples, from both business and politics. In January 2016, the Trump Foundation handed over some $2.82 million directly to Trump campaign staff, for them to disburse as they saw fit; those donations were specifically targeted to states with upcoming primaries where Trump was running as a candidate. They were often handed out to local charities by Trump personally, in the form of oversize photo-op checks featuring Trump’s “Make America Great Again” campaign slogan. What’s more, the money had been donated by the public for veterans; it was not even Trump’s personal money. People thought they were donating to veterans, but really that money went to Trump campaign stunts.

That example isn’t murky at all; it’s illegal. Charitable foundations are not allowed to engage in political activities, period. But in Trump’s mind, the Trump Foundation was never really a charitable foundation, created for acts of selfless generosity. Instead, it was little more than a money-laundering machine: Donors with their own ulterior motives could give tax-deductible donations to the foundation, and then in turn the foundation would be used whenever Trump wanted to funnel money to a nonprofit.

When the Trump Organization wanted to buy a $5,000 ad for Trump International Hotels in DC Preservation League charity event programs, it used Trump Foundation funds to pay for it. And when Trump needed to pay the North American Land Trust to manage land he had donated under a conservation easement, he asked the Trump Foundation to write the $32,000 check. (Even the land donation was transactional: Trump doesn’t need to build on the property, he just wants to make sure that no one else builds on it. So he gave it away under an easement, receiving a tax deduction in return.)

The New York attorney general’s 41-page complaint is detailed and compelling: The Trump Foundation was a Trump Organization slush fund; it wasn’t a genuinely charitable endeavor. Most foundations are much more careful to have proper board oversight and to comply with all applicable nonprofit law. After all, if you’re rich enough to set up a foundation, you’re rich enough to set it up properly.

And yet there’s a good chance that the Trump Foundation is only the grimy tip of the iceberg, when it comes to self-dealing and other dubious activities at small family foundations. In 2015, 109,550 private foundations filed tax returns with the IRS, and almost none of them will ever be investigated by their state’s attorney general. Many of them have family members on the payroll, and it’s very common for foundations to spend money on travel, real estate, and other expenses that directly or indirectly benefit the donor family.

Is Trump-style self-dealing abnormal for the Gates Foundation or the Ford Foundation? Absolutely. Is it abnormal for the Joe Schmuck Family Foundation? It’s impossible to answer that question with any certainty, because state AGs don’t tend to do multiyear investigations into family foundations. But go to any gala dinner and take a look at who’s buying the tables: You’ll surely find the Schmuck family, and their guests, at the Schmuck Family Foundation table, happily climbing the social ladder and enjoying the open bar.

Trump is an outlier, then, more in degree than in kind. He’s what happens when transactional philanthropy is taken to its logical conclusion, divorced entirely from any kind of genuine generosity. But the broader phenomenon is much bigger than Trump and has long infected almost every cranny of the philanthropic world.