That answer echoed the “3 a.m. phone call” ad that Mrs. Clinton’s campaign ran during the 2008 Democratic primary as proof that she was more reliable on national security than Barack Obama. But while, in 2008, the Democratic base was sick of hawkishness and far enough removed from 2001 to yearn for an antiwar candidate, 2016 may favor Mrs. Clinton’s experience in times of strife.

In the 2004 campaign, Gov. Howard Dean of Vermont emerged as a front-runner, earning the endorsement of Al Gore and standing out in the field as an antiwar firebrand. In December 2003, just before the Iowa caucuses, Saddam Hussein was captured, giving the Bush administration a much-needed win and increasing hopes that the Iraq war wasn’t a quagmire-to-be after all. It was John Kerry, a Vietnam veteran who voted as a senator in 2002 to give the president the authority to use military force in Iraq, who won at the Iowa caucuses, not Mr. Dean.

David Wade, who served as press secretary during Mr. Kerry’s 2004 campaign and went on to serve as chief of staff under Mr. Kerry at the State Department, noted the political challenges of that time. “We were campaigning in an age of color-coded homeland security alerts,” Mr. Wade said. “It’s a very tricky exercise to run a presidential campaign, particularly as a challenger, against the backdrop of unpredictable and unfolding national security events.”

When campaigning during a period of crisis, style can be more important than substance. Voters want to feel safe more than they want to read a five-point plan on intelligence operations and coalition building. According to Mr. Wade, voters want to answer the question, “Can I picture this person in my living room on my television as commander in chief when something bad happens?”

Ultimately, the Democratic electorate decided in 2004 that Mr. Dean did not pass the commander in chief test. Today, we may see a similar trajectory for Democratic voters who might have common ground with Mr. Sanders on economic issues, but can’t quite picture him in the Situation Room.

Matt Latimer, a former speechwriter for George W. Bush, said that as voters’ attention is drawn more to global instability, the love for political outsiders may fade. “The nation is going to select a new commander in chief, and at times like this they will be drawn to candidates who look the part,” Mr. Latimer said. “That probably is not helpful to someone like a Ben Carson or a Bernie Sanders.”

The psychologist Abraham Maslow’s hierarchy of needs holds true in politics, too. When humans feel threatened, they are less inclined to take risks — whether that meant, in ancient times, venturing farther away from caves, or voting for a candidate who is not a known political entity. When an attack like the one we saw in Paris throws our own national security into question, seeking out a maverick candidate tends to take a back seat to finding someone safe.