She flew missions in Afghanistan and Iraq, and then did a tour at the Pentagon and as a fellow in Congress. She turned down a possible promotion to have the second of her three children, and earned a master’s degree in international relations from Johns Hopkins. After that, she taught at the Naval Academy, and a guest speaker one day was Ben Chandler, a former Congressman from her home state of Kentucky. He gave her his card and asked her to call if she ever needed anything.

Forty-eight hours after Mr. Trump’s election, Ms. McGrath was rummaging through a drawer to find Mr. Chandler’s card. She quickly wrote him an emotional email.

“I never really thought I’d ever write you to ask you for some guidance but this week has left me numb,” she wrote. “I’m so taken back by who our nation elected president and what he stands for that I feel as if I must do something. I’ve spent my entire adult life in the service of this country, three combat tours, and literally years of my life living in tents overseas. I love this country, but I’ve never been more ashamed and embarrassed to be an American as I was waking up on Weds morning.”

She wanted to run for Congress. Mr. Chandler put her in touch with his former campaign manager, and she was off.

“I am deeply disappointed in the president,” she said. “His character, almost everything he has done in his life and stood for in his life is against everything that I have tried to stand for and do.”

If Ms. McGrath is to win her primary race, it appears likely that she will have to do it as an insurgent.

Ms. Sherrill does not have that burden. With the strong backing of her party, she is favored to win her primary and her chances for winning the seat increase with Mr. Frelinghuysen’s retirement announcement. She does not speak of Mr. Trump with the sharp edges of Ms. McGrath, focusing her criticism instead on the new tax law and the president’s effort to weaken the Affordable Care Act.