The attorney general of New York sued Donald Trump and three of his children on Thursday over what she described as “persistently illegal conduct” at the family‘s charitable foundation, an organization that has been good for the Trump family business and for Donald Trump’s political career but appears to have no philanthropic mission or focus.

In the suit, Barbara Underwood says she wants the charity dissolved and the remaining $1 million in assets to be given out to actual charities that do actual good. She also wants Trump to pay $2.8 million in restitution.

As David Fahrenthold of the Washington Post, who has done dogged work covering the Trump foundation since the campaign, has reported, funds from the charity were put toward decorating one of Trump’s golf clubs and to stage a multimillion-dollar giveaway at his 2016 campaign events.

At times the level of self-dealing inside the charity becomes downright comical. It spent $20,000 on a portrait of Donald Trump, Fahrenthold discovered, and $12,000 on buying Trump an autographed Tim Tebow helmet. When Trump’s Mar-a-Lago club racked up $120,000 in fines from the town of Palm Beach, Florida, for violating a local ordinance regarding the height of flagpoles, Trump eventually settled the dispute by agreeing to a $100,000 donation to a veterans’ charity — and then had his foundation rather than the club pay the tab.

At one point, the Trump Foundation operated like a fairly normal rich person’s poorly managed family foundation, receiving money from its founder and handing it out to this or that randomly selected cause. But in more recent years, as its founder has gotten less interested in real estate development and more interested in media celebrity and politics, it’s become rather unusual.

The Trump Foundation isn’t funded by Trump’s own money. Instead, contributions mostly seem to come from a range of Trump’s business partners, allowing him to parlay celebrity into securing credit for charity work.

But much of the foundation’s spending doesn’t really fit the traditional conception of philanthropy at all. Some of the money seems to flow back into Trump’s pockets through his businesses, while other funds are used to punish his political enemies or try to gain new friends in the conservative movement.

It has even been used to pay out more than a quarter-million dollars to help settle lawsuits on behalf of Trump's private businesses — just one of several times Trump has used tax-exempt nonprofit money in ways that violate the letter or the spirit of the laws governing charity in the United States. The Trump Foundation also appears to have been linked to efforts to shield Trump’s fake university from legal scrutiny.

Trump has also lied about the foundation repeatedly, claiming credit for charitable contributions that never happened.

The Trump Foundation is considerably smaller in scale than the much-more-covered Clinton Foundation, but it also gives every appearance of being much less involved in actually helping people and much more clearly involved in rule-breaking.

Yet while the Clinton Foundation has been the subject of dozens of investigations and thousands of takes over a period of nearly a decade (my first Clinton Foundation take was published in October 2007, for example) the Trump Foundation has gone largely unscrutinized, except by Fahrenthold.

Now that Trump’s organization is headed to court, maybe that will change.

What does the Trump Foundation do?

The Trump Foundation does not have what you would call a clear and straightforward charitable mission. It doesn’t focus on a particular social problem or set of social problems. Instead, it reflects the shifting agendas of its notoriously mercurial founder.

For example, back in 2014 the Trump Foundation made a $100,000 contribution to David Bossie’s conservative activist group Citizens United.

At this time, then-New York attorney-general Eric Schneiderman (who has since stepped down over accusations of domestic violence) was launching a fraud prosecution against Trump and Trump University. Bossie and Citizens United, meanwhile were suing Schneiderman in federal court over his effort to require nonprofits like Citizens United to disclose their donors under seal to the New York State Charities Bureau. The lawsuit was dismissed, and it’s hard to characterize this as a quid pro quo since Bossie’s interest in the cause of nontransparent political fundraising is well-known and sincere.

But Trump had never previously supported Citizens United, and, as Michael Isikoff reports, the Citizens United donation "was by far the largest it gave to any organization that year, substantially exceeding its contributions to more traditional charities, such as the Leukemia and Lymphoma Society (which got $50,000), the Dana-Farber Cancer Institute ($25,000) and the Police Athletic League ($25,000)."

Trump, in essence, had an enemy in Schneiderman, so Trump used his foundation money (money which, recall, was not donated out of his own pocket) to help an enemy of his enemy.

Another oddity of the Trump Foundation is that even though it gives the superficial appearance of being a normal family foundation, he doesn’t actually fund it anymore and hasn’t done so for years. Trump is rich, and back in 1988 he created the foundation and bestowed it with the proceeds of his book, Trump: The Art of the Deal. The foundation’s specific undertakings didn’t receive much attention over the years, as Trump wasn’t running for office and nitpicking the details of a wealthy individual’s charitable giving is considered rude. Trump’s campaign has changed that to an extent, and shined some light on a variety of unorthodox practices.

"For one thing," Fahrenthold writes "nearly all of its money comes from people other than Trump. In tax records, the last gift from Trump was in 2008. Since then, all of the donations have been other people’s money — an arrangement that experts say is almost unheard of for a family foundation."

Wait — Trump’s foundation isn’t his own money?

That is correct. It’s not unusual for a nonprofit to be primarily financed by donors rather than by the founder, but that’s a very unusual situation for a family foundation.

And, indeed, Trump’s foundation didn’t start out this way. Between 1987 and 2006, Trump gave $5.4 million to his foundation with the vast majority of the money going out the door quickly to a range of fairly banal nonprofits. It never amassed a large war chest, and by the start of 2007 it had just $4,238 in assets. Nor did the Foundation ever hire professional staff or independent directors, relying instead on unpaid work by a five-person board composed of Trump himself, his daughter Ivanka, his sons Eric and Donald, and Allen Weisselberg, the Chief Financial Officer of the Trump Foundation. Tiffany Trump did not make the cut for some reason.

Trump’s donations trickled in 2007 and 2008, and from 2009 onward Trump has given no money to the Foundation. Its largest donor, instead, is wrestling executives Vince and Linda McMahon, who’ve given $5 million as part of a relationship with Trump that’s included him making appearances on their wrestling broadcasts.

Another noteworthy donor is NBC Universal, the company that aired Trump’s television show, The Apprentice (NBC Universal is also an investor in Vox Media, Vox.com’s parent company), on which Trump pledging to make charitable contributions was a regular feature.

As Fahrenthold, writing with Alice Crites, explains:

The same thing happened numerous times on "The Celebrity Apprentice." To console a fired or disappointed celebrity, Trump would promise a personal gift. On-air, Trump seemed to be explicit that this wasn’t TV fakery: The money he was giving was his own. "Out of my wallet," Trump said in one case. "Out of my own account," he said in another. But, when the cameras were off, the payments came from other people’s money. In some cases, as with Kardashian, Trump’s "personal" promise was paid off by a production company. Other times, it was paid off by a nonprofit that Trump controls, whose coffers are largely filled with other donors’ money.

As Christine Wilkie of the Huffington Post has detailed, many of the contributions seem to be transactional in a similar way. People Magazine gave $150,000 in exchange for exclusive photos of Trump’s son, Barron. Comedy Central gave $400,000 as an appearance fee for Trump appearing on The Comedy Central Roast of Donald Trump. Norwegian Cruise Lines gave $100,000 as an appearance fee for Melania Trump. Depending on whether or not the money was put to good use (more on this later), this could be seen as a form of Trump channeling his celebrity to philanthropic ends or else as not much more than a glorified tax dodge.

Some of the donations reflect ambiguous business relationships. Wilkie reports that Donna Clancy gave the Foundation $100,000 while she was also a tenant at a Trump-owned office building, while the Foundation’s most frequent donor over time is Stark Carpets, a company that Trump uses as a carpet-supplier for many of his buildings.

But while some of the donations to Trump’s foundation seem like a form of thinly disguised employee compensation, others are more enigmatic. The high-end ticket scalper Richard Ebers, for example, is one of the Trump Foundation’s biggest donors, and Ebers declines to comment to the media about it.

Who else has Trump given to?

Over the years, Trump’s foundation certainly has given money to a grab-bag of basically banal uncontroversial charities. But since 2012, the Trump Foundation has given a lot of money to conservative political groups as part of Trump’s effort to establish his bona fides in the movement. This is perfectly legal — the tax code doesn’t draw a distinction between what a normal person would call a "real charity" and what a normal person would call a political advocacy shop — but there is a common sense difference between donations that aim to help people and donations that aim to advance the donor’s own political career.

Some examples gathered by Wilkie:

$100,000 to the Billy Graham Evangelistic Association and $35,000 to Samaritan’s Purse, both run by Franklin Graham who later defended Trump during the controversy over his proposal to ban Muslims from entering the United States.

$40,000 to the Drumthwacket Foundation, a charity whose mission is the upkeep of the New Jersey governor’s mansion and whose donors mostly have close ties to Chris Christie.

Trump sponsored one of Sen. Rand Paul’s trips to Guatemala where the senator in his capacity as a physician performed eye surgeries for needy patients.

He’s also given money to a grab-bag of second-tier conservative advocacy groups including the American Conservative Union, Justice for All, and the Family Leader Foundation.

The Foundation also engages in a certain amount of what seems to be self-dealing.

Fahrenthold reports, for example:

Melania Trump paid $20,000 at a charity auction for a portrait of Donald Trump. The Foundation cut the check, and the portrait reportedly landed at one of Trump’s golf courses.

Trump himself paid $12,000 at a charity auction for a football helmet autographed by Tim Tebow.

The Foundation also donated money to Florida Attorney General Pam Bondi, which was clearly illegal and resulted in a fine when it came to light. According to Fahrenthold, "Trump’s staffers said a series of errors resulted in the payment being made — and then hidden from the IRS."

There are also mixed cases, such as Trump giving Foundation money to the Palm Beach Police Foundation, which then in turn spent large sums of money on renting out the Trump-owned Mar-a-Lago resort for its annual gala.

Last but by no means least, the Foundation simply seems to sometimes just not do anything.

"Five times," Fahrenthold reports in a separate story, "the Trump Foundation's tax filings described giving a specific amount of money to a specific charity — in some cases, even including the recipient's address. But when The Post called, the charities listed said the tax filings appeared wrong. They'd never received anything from Trump or his foundation."

In one of the five cases, the phantom donation is related to the paperwork errors that led Foundation money to be sent to the Bondi campaign. But the other four — phantom donations to the Giving Back Fund, Children’s Medical Center in Omaha, the Latino Commission on AIDS, and Friends of Veterans — remain unexplained.

Stopped by @TrumpDC to thank all of the tremendous men & women for their hard work! pic.twitter.com/oGcJL4N454 — Donald J. Trump (@realDonaldTrump) September 12, 2016

Donald Trump hates lies, but can't tell the truth