Congressional candidate Madeleine Dean, right, talks to voter Bisa Bullock in Norristown, Pa., on May 11. (David Weigel/The Washington Post)

They were two first-time candidates running for congressional seats in Pennsylvania. Both in their early 30s. Both former prosecutors. Both military veterans who served in the Pacific.

There was one big difference: Conor Lamb’s appeal as a fresh face and political outsider helped propel him to an upset victory in a March special election in a Pittsburgh-area district. Across the state in Bucks County, Rachel Reddick on Tuesday lost a Democratic primary by more than 20 points to millionaire Scott Wallace, who tapped his fortune to outspend her by nearly 8-to-1.

Reddick understood the challenge she was up against when it came to financial resources, but another obstacle caught her off guard. “One of the largest surprises for me was having people dismiss my experience,” she said. Again and again, she was branded as “a novice” out of her depth, Reddick recalled, something she contends “relates directly to my gender.”

So far, this has been a very good year for women running for office — including in Pennsylvania, the largest state in the country with an entirely male congressional delegation, and 49th out of 50 in the proportion of women in elected office.

That balance will likely change come January. A redrawn congressional map is expected to break the gerrymandered lock that Republicans have on much of the Keystone State. Democrats on Tuesday nominated three women — Chrissy Houlahan, Mary Gay Scanlon and Madeleine Dean — in districts where they are expected to win in November. Another, Susan Wild, will be running in a district that could go either way.

The climate for female candidates — a byproduct of Trump-era backlash — is favorable enough to draw comparisons to the 1992 cycle, branded “the year of the woman.”

But hold the euphoria. Unlike the pathbreaking women who shook up politics a quarter-century ago, many of those running in 2018 are jumping in without having run for anything before.

So this is a learning experience, one that requires them to temper their idealism with a recognition they are dealing with forces that continue to work against women aspiring to elected office, and particularly those from outside the political establishment.

Those forces go beyond the kind of lingering gender bias that Reddick sensed.

In Pennsylvania, for instance, some female contenders struggled to win endorsements from local party committees. “It is an old-boy, county-party club that feeds into the state legislatures, that feeds into these other races,” said Dean, a Pennsylvania state representative who easily won her three-candidate congressional primary. “The women are going to outwork the men, and that will make all the difference.”

“This area is all about deep roots, deep connections,” said Shavonnia Corbin-Johnson, 26, an African American who finished a narrow second in a four-way Democratic primary for a Republican-held House seat in south-central Pennsylvania. “Who do you know? How do you know them? For that reason, it kind of holds a lot of women back.” Among the questions Corbin-Johnson said she was routinely asked by voters, male and female: Why are you single?

Nor are Democratic women the only ones struggling against institutional forces in a male-dominated system. In Tennessee, Republican Ashley Nickloes already had an idea what that was like. She announced her bid for Congress in February, a few days before deploying to the Middle East as a lieutenant colonel in the Air National Guard, where she is the only female pilot in her squadron.

Now back in Knoxville, Nickloes is fighting to overtake two front- runners in a crowded primary. “It’s an uphill race,” she said. “It’s really making the connections. These guys have been running for two years, and since they’re career politicians, they know who to reach out and touch.”

That includes who to touch for fundraising. Katie Muth, a 34-year-old local activist, had no Democratic opposition in her bid for a GOP-held state Senate seat outside Philadelphia. But she was aghast when political veterans told her it will take upward of $1 million to mount a credible general-election campaign.

“That’s like Monopoly money,” she said. So far, Muth has raised a little over $70,000 and is coming up with creative ways to cut costs — for instance, by having her supporters write postcards by hand and send them to voters, rather than paying for mass mailers. “My path to victory isn’t going to be the traditional one,” she said.

Organizations such as Emily’s List and Emerge America scout female political talent across the country and provide the mentoring that so many female candidates lack, coaching them on fundraising and building a campaign operation. Still, there really is no substitute for going out and doing it.

The arithmetic of politics means that more candidates lose than win. But the women who fall short will have learned a lot. Let’s hope we will hear from them again. After all, the next election will be only two years away.