Here’s an essential fact about political money, as presidential candidates head into the slow summer fundraising months: it spends.

Although the massive Democratic primary field has collectively raised $277 million so far, almost three-fifths of the money flowed into the coffers of only five campaigns, according to new filings with the Federal Election Commission.

What that means: a few top candidates are racing to expand their campaign staff and advertising budgets. Most of the rest will pour their dwindling resources into crossing the Democratic Party’s fundraising thresholds for debate participation — or simply paying their bills.

No fewer than 11 campaigns of Democratic presidential hopefuls — including Sen. Cory Booker of New Jersey, Sen. Amy Klobuchar of Minnesota, Sen. Kirsten Gillibrand of New York, Washington Gov. Jay Inslee and former Rep. Beto O’Rourke of Texas — spent more money during the year’s second quarter than their campaigns raised during the same period.

Most of these candidates still have cash on hand — some because of fat reserves they transferred from their Senate or House campaign committees. But candidates can only survive on such cash for so long before they slash staff, cut budgets and struggle for viability. And strong fundraising by President Donald Trump, whose campaign has so far raised about $135.6 million toward the 2020 election, is adding to the pressure.

Former Colorado Gov. John Hickenlooper’s campaign on Monday emailed supporters what it called a “harsh truth”: the July presidential debate in Detroit “could be John’s last opportunity to take the stage” if the campaign doesn’t hit fundraising benchmarks.

O’Rourke on Tuesday emailed supporters to assure them that his campaign has “enough air in the lungs to make it up the next hill.” But he acknowledged the campaign needs “pick up our pace” on fundraising “to ensure we have the same resources to spread our message, to meet voters, and to compete in Iowa, New Hampshire, South Carolina, Nevada, Texas, and every state across this country.”

Money is “one of the few ways this early that we have to measure viability,” said Kelly Dietrich, a longtime Democratic strategist who founded and runs an organization that trains Democrats to run for office and work on campaigns.

Dietrich said paying staff on the ground is essential: “You can’t build relationships and understand who is who and get the nuances if you don’t have staff. It’s about capacity.”

Cash-flush campaigns, meanwhile, are shifting their spending. They’re opening offices and retooling digital ad campaigns away from debate-threshold-driven $1 requests — and toward policy positions.

Sen. Bernie Sanders of Vermont will be at the opening of a new office in Council Bluffs, Iowa, this Saturday, according to his campaign. Sanders intends to invest in his campaign operations in both Iowa, which in February conducts the nation’s first presidential caucus, and Nevada, which holds its caucus later that month.

Campaign finance reports show Sen. Elizabeth Warren of Massachusetts spent about $1 out of every $3 her campaign raised during the year’s second quarter on salary and payroll expenses for her roughly 300 staff members. Last month, Warren’s campaign announced it would open four field offices in New Hampshire, which hosts the first-in-the-nation presidential primary in February.

South Bend, Indiana, Mayor Pete Buttigieg, who raised more from individual donors than any other Democratic candidate this quarter, has so far spent conservatively. But his campaign recently said it now employs 250 staff members.

More than half of former Vice President Joe Biden’s campaign spending went to either digital advertising or payroll.

The amount Sen. Kamala Harris of California is spending on salaries appears to have tripled from the year’s first quarter to the second quarter, a Center for Public Integrity analysis of campaign finance filings found.

Presidential campaigns were slow to staff up in New Hampshire this election cycle, said Raymond Buckley, chairman of the New Hampshire Democratic Party. This is at least partially because prospective campaign operatives, like donors, had trouble deciding which candidate to support “because there were so many that were acceptable.”

Now, Buckley said, the investment in the state is robust. “A wise campaign understands that going all in in Iowa and New Hampshire pays off,” Buckley said.

One of the biggest expenditures for most presidential campaigns is digital advertising aimed at reaching donors and engaging supporters — donors and supporters who can later be turned into volunteers and voters.

Former Housing and Urban Development Secretary Julián Castro, for example, raised $1.1 million — about 40 percent of his cash for the second quarter — in the four days following a breakout debate performance on June 26, according to his campaign. Castro spent more than $1 out of every $3 on digital advertising during the second quarter.

Tara McGowan, chief executive of Acronym, a liberal organization that tracks digital spending by candidates, said all the campaigns are investing in it at a “heavy rate at this stage” — but their strategies vary depending on how the candidates are doing.

Since the June debate, Castro, for example, has been fundraising to build his momentum, McGowan said.

Others, such as Warren, are using digital media to give supporters sharable information on specific policies.

“It’s really important to think about to what end you’re reaching voters online with ads,” McGowan said. “Are you giving them more info about why they should support you, or are you just begging?”

Chris Zubak-Skees contributed to this article.