Donald Trump used fundraising for veterans as an excuse for his absence from a Fox News debate.

Donald Trump claimed it took only an hour to raise $6 million for veterans. “We set up the website. I called some friends,” he said. And, just like that, 20 veterans’ groups were told to expect “a lot of money.”

Indeed, if all you’d read about veterans groups in the past few weeks was coverage of Trump’s fundraiser, or Wounded Warrior Project’s reportedly big spending, you might think the nonprofit sector serving veterans was flush with cash and maybe even undeserving of your support.

But those stories obscure two trends that are working against veterans groups: The needs of the veterans population are increasing at the same time that the base of support for veterans services is shrinking. And it’s because of those trends that veterans nonprofits are evolving in ways that open them up to criticism.

The U.S. veterans population size peaked in 1980 and has been steadily declining since then, as the conscription-fueled cohorts of World War II, Korea, Vietnam and the Cold War fade. Assuming that longevity remains relatively constant, this trend will continue as long as the United States maintains a volunteer force of a certain size and does not fight another war on the scale of World War II. At some point around 2030 or 2040, the veterans population will reach a new steady state of approximately 14 million — a small slice of a country of 325 million.

Those numbers, however, can be deceiving. Today’s smaller veterans population is increasingly dominated by veterans of the All-Volunteer Force era, who serve with a fundamentally different social contract than previous generations of volunteers or conscripts. They expect higher compensation and generous benefits in return for accepting greater burdens. On average, they serve longer on active duty, deploy more frequently and endure more injuries, illnesses and general wear and tear in the line of duty (excluding combat injuries). Also, because the military has grown more insular, today’s veterans sometimes have a harder time transitioning back to civilian life. The result has been increasing use of public, private and nonprofit veterans services by all generations of veterans, although the veterans of our most recent wars are using programs such as VA health care and the GI bill at record levels.

The federal government will likely meet this need with fewer resources in years to come. Although the Defense Department and Department of Veterans Affairs have enjoyed increased budgets during the past 15 years of war, those budgets have likely reached their high-water mark. Benefits and support will remain on the books, but they will be gradually starved for dollars. VA medical appointments will become even harder to get; GI Bill funds may eventually be rationed or capped; employment support programs that fall outside VA’s core mission of health and disability support could wither.

Meanwhile, some of the nation’s largest veterans organizations are struggling. Traditionally, the majority of these have been membership organizations — groups like the American Legion and Disabled American Veterans — that depend on dues and contributions from veterans, as well as donations from veterans’ families and people with some military affinity. But their membership ranks have declined along with the veterans population. Veterans of my generation simply aren’t replacing older veterans in as great numbers, or with as much disposable income (yet), to make up the difference. And the growing civil-military divide is getting in the way of giving.

As Katherine Kidder and I document in the report “Charting the Sea of Goodwill,” the vast majority of veterans nonprofits earn less than $100,000 per year. Only 237 of 42,035 organizations pulled in more than $1 million during the last tax year for which data was available. And for all of the nonprofit organizations in this space, revenue had effectively remained flat during the past 15 years of war, rising just 4 percent in inflation-adjusted dollars between 2001 and 2014, compared to a 37 percent increase for all U.S. nonprofits in revenue during the same period. When we added government funds to this picture, accounting for the enormous amount the VA has spent since 2008 on combating homelessness, largely through grants and contracts to nonprofits, it appeared that corporate, philanthropic and individual donations to the veterans nonprofit sector were actually on the decline.

These trends present veterans nonprofits with an existential dilemma. Different organizations have responded in different ways, and it is this context that matters for understanding the allegations against Wounded Warrior Project, or why some veterans groups were okay with Trump using them to excuse his absence from a Fox News debate and shield him from questions about his lack of military service.

Many nonprofits focused on service delivery — such as those providing supportive housing for homeless veterans — have evolved into small- to medium-sized businesses that essentially operate on a fee-for-service basis, funded primarily by government contracts or grants, with their budgets supplemented by charitable giving. Since such giving is increasingly difficult to attract, there’s a powerful incentive to take funds from angel donors. “Our budget is, like, $40,000 a year,” the founder of an Iowa group for homeless veterans that got $100,000 from Trump told The Post. “Our largest donation was $10,000. So this is a pretty big deal for us.” (As The Post reported, Trump has followed through on donating only half of the $6 million raised, leaving some veterans groups extremely disappointed.)

Other groups, such as Wounded Warrior Project, have transformed into something perhaps best described as a services machine built on top of a fundraising machine. They’re able to succeed despite serious economic and demographic headwinds because they have high overhead. Their cost structures, executive salaries and expense profiles look more like businesses than nonprofits. They market themselves with a competitive spirit more akin to General Electric than Goodwill. And they engage in the same “make or buy” analysis that most big companies do when deciding whether to insource or outsource a particular task.

Recognizing that it cannot do all things for all veterans, Wounded Warrior Project now funds a number of the most prominent post-9/11 veterans groups, including Team Rubicon, Team RWB and The Mission Continues. It also funds major research projects, such as a longitudinal study being run by the Henry M. Jackson Foundation for the Advancement of Military Medicine and a study of military caregivers overseen by the Dole Foundation and run by the RAND Corporation last year. (Full disclosure: WWP funds Center for a New American Security research, too, accounting for roughly 10 percent of my program’s funding and 2 percent of the overall center’s funding.)

Veterans nonprofits will need to continue to evolve. If they cling to old business models, they will become increasingly vulnerable to economic shifts, government funding decisions and opportunistic donors like Trump. To remain viable, nonprofits must now compete in the marketplace and show their value to all customers, including funders, members and users. Financial ratings and tax filings tell one part of the story. But nonprofits also must do better at demonstrating their impact, ideally by showing how they have meaningfully changed outcomes like health and wealth for veterans who use their services.