Jennifer Carroll Foy holds campaign literature to hand out before the election. Foy, who was running for the 2nd District of the Virginia House of Delegates, won her race on Tuesday, joining a wave of women newly elected to the Virginia legislature. (Photo by Katherine Frey/The Washington Post)

The story line emerging from Tuesday’s statewide elections in Virginia and New Jersey revolves around Donald Trump. Observers have focused on what the Democrats’ big night means for Trump’s political fortunes, the future of “Trumpism” in the Republican Party, and the 2018 midterms.

But on a night that saw a record number of female candidates, and major wins by women in Virginia, what do the results tell us about women and politics? We see three takeaways.

1. There was a Trump effect.

For a year now, Democratic women have been angry, energized and active. And last night, their dismay with the president appears to have been a key factor in both states’ election outcomes.

In Virginia, Democratic gubernatorial candidate Ralph Northam won 61 percent of the vote among women, according to exit polls. In New Jersey, Democrat Phil Murphy won the governor’s race thanks to 55 percent of the women’s vote. It’s not unusual for women to support Democratic candidates, but these margins proved to be a significant advantage, especially for Northam on a night when Democrats turned out to vote at high rates.

The results of a Politico/American University/Loyola Marymount University poll from May 2017 help explain why women may have so strongly backed Democratic candidates on Tuesday.

The survey found that 70 percent of Democratic women were “appalled” by Trump’s victory, more than two-thirds were “shocked” by it, and more than half reported feeling “angry” and “depressed.” Nearly three-quarters of Democratic women reported “a sick feeling” when they saw Trump on the news. The women with the most visceral reactions were roughly four times as likely to engage politically after Trump’s victory than they were before it. For Democratic women in New Jersey and Virginia, casting a ballot may have represented yet another way to express their displeasure with Trump.

The Trump effect goes beyond voters, however. Virginia and New Jersey also saw a record number of female candidates running for state legislative office. In Virginia, 53 women appeared on the ballot — an 18 percent increase from a previous record of 45. In New Jersey, the 79 women on the ballot also represented a high point, up nearly 10 percent from 72 in 2013.

It’s well known that women are much less likely to run for office than men, and the overwhelming majority of candidates in both states Tuesday were indeed men. But many of the new Democratic women who chose to throw their hats into the ring this cycle attributed their candidacies to Donald Trump.

2. Women made major gains by taking chances in all kinds of contests.

In Virginia, female Democratic candidates were on the ballot in five open seat races, winning three of them. But Democratic women also knocked out eight male Republican incumbents, several in long-shot contests. Defeating incumbents is hard to do. But by capitalizing on a favorable political environment and running in all types of contests, women made big gains.

When the House of Delegates convenes in January, rather than 17 women, there will be at least 25 (another two races featuring women are still too close to call). That’s roughly a 50 percent increase in women’s representation.

In New Jersey, on the other hand, the number of women serving in the legislature will decline slightly in the Senate and hold steady in the Assembly. Why? One reason is because no women competed in the three open seat Senate contests. And although eight Democratic women tried to unseat Senate Republican incumbents, none succeeded.

The electoral landscape of course varies from state to state and district to district. But the disparate outcomes in New Jersey and Virginia underscore that one of the keys to increasing women’s representation is having women running in all kinds of districts, both open seat and incumbent-held.

3. A Democratic “Year of the Woman” has a potential downside.

The vast majority of the female candidates in Virginia and New Jersey were Democrats. In Virginia, it was 81 percent; in New Jersey, 61 percent. And the same was true of the winners.

These facts highlight how women’s electoral fortunes depend on the vagaries of the political environment much more than do men’s. When Democrats have a good night — as happened Tuesday, especially in Virginia — so do female candidates. But when the political environment favors Republicans — as was the case in 2010 and 2016 — the gains for women tend to be much smaller, if there are gains at all. Ultimately, the prospects for substantial increases in the number of women in political office depend on getting more women to run from both sides of the aisle.

What does this mean for the 2018 midterms?

Tuesday’s election results highlight the factors that influence female candidates’ chances, women’s gains and losses, and overall levels of numeric representation on the horizon. But they also serve as a clear reminder that substantial gains in women’s representation can happen when just a few dozen more women than usual decide to run for office.

Jennifer L. Lawless is professor of government and director of the Women & Politics Institute at American University.