FULLERTON, California—In April of 2017, Phil Janowicz became the first Democrat to announce his candidacy against Republican Rep. Ed Royce in California’s 39th District, a seat that Royce had held, in one form or another, since 1993. For decades, no one had realistically thought Democrats could topple Royce, but Janowicz, a tenured chemistry professor, spent the rest of the year trying to build a Democratic base in the district, which contains much of northern Orange County. The area is a longtime Republican stronghold that’s started to become more purple in recent years as demographics slowly shift. By the end of the year, Janowicz’s polling showed him in the lead among the declared Democratic candidates.

On Jan. 8, when news broke that Royce wouldn’t run for re-election, Janowicz looked at his phone and saw 11 missed calls.

“My initial thought after I found out the news, was, ‘Oh wow, that’s going to be really good for November!’ ” he told me. Immediately after thinking that, though, he recognized the problem: “Oh crap, that’s going to make June much harder.”

“It took five seconds for that mental gymnastics to occur once I learned the news,” he said.

With Royce on his way out, more Democrats flocked to replace him. Jay Chen, a Democrat who had mustered 42 percent of the vote running against Royce in 2012, jumped into the race, as did numerous other Republicans eager to fill Royce’s seat. Before long, more than 15 candidates were in the race.

“Logically, I was at peace within about 30 seconds. Emotionally, get back to me later, because I’m still working through that.” — Phil Janowicz

This presented a uniquely California problem. Because the state operates under a “top-two” election system, all of those candidates—Republican and Democrat— compete in a single June primary, and the top two—regardless of party—advance to the general election in November. With so many Democrats now in the race, the party was suddenly in danger of fracturing its own vote, and allowing Republicans to finish first and second.

Democrats soon recognized that they needed to cull the field of candidates to avoid the possibility of getting “locked out” in a district that could prove crucial to reclaiming the House majority. The problem has put national Democrats in the awkward position of trying to persuade some of their most enthusiastic candidates to give up their bids for office, and it has left the party in a vintage state of disarray in the 39th District, and several others, as the state barrels toward its primary on June 5.

Ironically, perhaps, the “top-two” system, a poorly thought-out exercise that good-government types pushed through in a 2010 referendum, saying it would produce more moderate officials, puts tremendous pressure on outsider candidates—mostly those without vast, personal fortunes—to drop out early for the sake of the party.

How do they make such an excruciating decision?

In Janowicz’s case, his campaign ran a poll in early March that showed him tied, at 9 percent, with two wealthy, self-funding Democratic candidates: Andy Thorburn, a former insurance executive, and Gil Cisneros, who won a $266 million lottery jackpot in 2010. The tie, unfortunately, was for third place, with two Republicans leading the field. When his campaign played around with the numbers, Janowicz found himself the odd man out: If he removed himself from the race, that would push a Democrat into the top two. “But if you removed anyone else,” he said, “it wouldn’t do anything.”

“When I got that result, I threw the paper,” he told me. “I knew that I had to fall on my sword.” With Cisneros and Thorburn possessing unlimited resources heading into the final push, the chance for recovery was distant at best, while the ability to serve as spoiler for the party was strong.

He dropped out on March 14, just before the filing deadline.

“Logically, I was at peace within about 30 seconds,” he said. “Emotionally, get back to me later, because I’m still working through that.”

Democrats in Washington had hoped other long-shot candidates might see things like Janowicz did. The Democratic Congressional Campaign Committee made a point of talking to all of the candidates in potential lock-out districts ahead of the filing deadline to present them with the cold truth: The fields needed to shrink if Democrats were to have any hope of winning these districts. Some didn’t take it so well.

In a phone call around the end of January, the DCCC notified Mai Khanh Tran, a medical doctor who entered the race for Royce’s seat last June, that it was only going to support the top two Democrats in their most recent polling. She wasn’t among them.

“It was presented in a way that I understood as, if I didn’t drop out, I would be the spoiler, I would be enabling this race to be a red-on-red race,” she told me over lunch on Tuesday, after a morning of canvassing. “My response to them was that I didn’t believe in the polls, that I think it’s not fair to the voters to be asking the only woman—the only qualified woman—the only doctor, the only first-generation immigrant, the only working mom who’s raised the most money in the field, and the one who’s been campaigning the longest, to drop out.” She wouldn’t have known what to tell her donors and supporters.

“I was very offended,” she said, and hasn’t spoken with the DCCC since. “I felt like they were targeting me.”

Tran has raised some $720,000, and personally loaned her campaign another $730,000. That would be an exorbitant sum for a primary campaign almost anywhere else in the country. In California’s 39th District, it makes her a piker. Cisneros, whom the DCCC added in April to its Red-to-Blue program for promising candidates, has loaned his campaign $3.5 million dollars from the fortune he amassed as a lottery winner. Thorburn, the former insurance executive, has kicked nearly $2.8 million into his campaign.

Since she’s not going to beat them on the airwaves, Tran has tried to beat them on the ground, personally canvassing for hours every day, with an emphasis on organizing Asian Democrats.

On Tuesday morning, armed with a list of potentially persuadable voters, she set about knocking doors—mostly seniors, who would be home during the day. Some of these voters appeared to know that they were showing up as swayable in the database and had parked signs for various candidates in their front yards to ward off the others from bothering them.

Tran, wearing sneakers and a T-shirt that said “ELECT MORE WOMEN,” was optimistic she picked up two votes at houses where she stopped for long conversations. She was grinning when she came back from the first, with a former teacher concerned about education funding, which allowed her to cite her endorsements from the National Education Association and California Teachers Association. When I asked her how often the issue of President Donald J. Trump comes up in a district that went for Hillary Clinton by 9 percentage points, she said “only a handful of times.” Sure enough, at the next house, she held a lengthy conversation with a voter who worried that “everything about America is being undermined and assaulted” by the 45th president.

That kind of anti-Trump enthusiasm has created a perverse problem for Democrats in California, where the get-involved ethos that followed Trump’s victory in 2016 has produced a surfeit of candidates with big dreams and little reason to heed the party apparatus. The large number of candidates also narrows the margin for victory, giving nearly every candidate some hope they could finish among the top two.

In Tran’s case, she said that she perfectly understood the DCCC’s logic in trying to winnow the field. She just didn’t, and still doesn’t, think she should be the one to leave.

“I am running on behalf of all the women.”

Jay Chen, who entered the race shortly after Royce announced he wouldn’t run again, became a favorite almost immediately. Unlike the rest of the candidates in the race, Chen had political experience, both from his 2012 challenge to Royce and his election to a school board and a college board. And unlike Cisneros, Thorburn, and Tran, he was a resident in the 39th District at the start of the campaign.

The biggest obstacle to Chen’s campaign came at the California Democratic Party convention in February, when he fell just short of the votes needed to secure the party’s endorsement.

“If no candidate won the endorsement of the party,” he said, “then it would just strengthen the hand of the self-financing candidates.”

Before the March filing deadline, the DCCC conducted another round of polling that showed Chen and Cisneros as the two leading Democrats. But it also showed that Republican turnout would likely be much higher than Democratic turnout in the district. In other words, if there were equal numbers of viable Republican and Democratic candidates, two Republicans would be more likely to shut out Democrats than vice versa.

A poll Chen’s campaign conducted shortly thereafter, similarly, found there would be about a 15-point difference in turnout. Though his numbers showed he would have had a chance to get into the top two if it were only he and Cisneros running against three viable Republicans, he wasn’t going to get that chance. The DCCC couldn’t persuade any of the others beneath him—be they Thorburn, Tran, or Sam Jammal, another first-time candidate in the district—to drop out of the race.

“It was one of the hardest decisions that I’ve ever had to make.” — Jay Chen

So party leaders got all of the 39th District candidates together in February to have a “powwow” to “lay out the reality,” as Chen put it. They asked the candidates, if you couldn’t win, would you get out of the race?

He was the only one who said he would.

“No one else would concede that as a possibility,” Chen said. “And I think for them, conceding that would show weakness, that you’re not confident in your own ability to win.”

Chen seemed frustrated with the stubbornness of the many candidates who had never run for anything but wouldn’t listen to logic in their pursuit of a congressional seat.

“I think if you’re newer to the process, and haven’t run before, you think you just have to barrel ahead, dam the torpedoes, full speed ahead, right? That’s your attitude,” he said. “I think if you’ve run before, you’ve experienced it, you would be more likely to take a nuanced approach to this kind of race.” And maybe settle for a lesser office.

With no one else willing to drop out, Chen, a stronger candidate than most of them, made the remarkable decision to end his own campaign after only two months, just before the filing deadline.

“It was one of the hardest decisions that I’ve ever had to make,” he told me. “Out of all the candidates, I’ve lived in this district the longest. I’ve cared enough about the district that I would run for local office first, because it’s not about the prestige of being in Congress, it’s about serving your community.”

Sam Jammal, who grew up in the district, would argue that he has plenty of political experience, just not as a politician himself. Though only 36, he has an impressive political résumé. After serving on the Obama campaign in 2008, he’s put in stints as an aide to Colorado Sen. Michael Bennet, an Obama Commerce Department official, and a chief of staff to California Rep. Tony Cárdenas. Most recently, he worked for Tesla. But in private polling, he still hasn’t been able to rise near the top of the field.

He, too, got the sit-down from national Democrats before the March filing deadline where, he said euphemistically, “they shared their perspective.” But after looking at his own polling, and finding so many of the candidates within the margin of error, and picking up some local Democratic club support, he “decided to continue forward because I know how important it is to win this seat, and I know my local roots and experience can get it over the top.”

Jammal, like Chen, didn’t donate any money to his campaign but has raised a solid amount—$533,000—or just enough to justify continuing his campaign. But where Chen calculated it was not worth continuing if he couldn’t keep up with Thorburn and Cisneros in fundraising, Jammal sees his campaign as an opportunity to show that regular people can still compete through local connections and organizing.

The difference shows how two candidates are able to look at the same set of data and come to dramatically different conclusions. Those who dropped out were able to suppress their feelings enough to let the percentages determine their decisions. The quickness and specificity with which they still remember the exact numbers from months-old polling and probabilities suggested that they still think about their decision to leave the race in every waking moment. That only doubles the frustration with other candidates, many with similar or even more distant odds, who refused to arrive at the same conclusions and could cost Democrats as a result.

When I told Jammal I was doing a story on the lock-out fears, he said he’s “not one who thinks it’s a real issue at this point. Our field shrunk, their field’s roughly the same size, and both fields are undecided.” He noticed, too, that outside GOP groups had recently put money behind the campaign of their front-runner, Young Kim, suggesting that her presumed spot in the top two wasn’t guaranteed.

“As long as we turn out our voters,” he said, “it shouldn’t be an issue.”

But that’s a big caveat.

Chen has seen the data from recent early voting in the 39th District, and, in an unfortunate display of predictive accuracy, it comports with that 15-point Republican advantage in turnout, which his polling showed months ago.

“The Democratic candidate, in order to get to the top two, needs to get 50 percent of the total Democratic vote,” he said. “Even if you have one front-runner, who’s doing really well, and they’re able to get 40 percent out of a field of eight candidates, which would be very, very difficult, that still probably wouldn’t be enough to get into the top two, just because of the structural deficit we have.”

At present, six Democrats remain in the race.

“I’m very, very worried,” he said.