Washington Nationals shortstop Ian Desmond, who also homered in the game, maneuvers around second baseman Asdrubal Cabrera and Brandon Crawford to turn a double play. (Katherine Frey/The Washington Post)

After the wave crested and the frenzy died down, after the whole loopy homestand reached a new level of madness Sunday afternoon, the Washington Nationals provided something close to an explanation for how it had happened. They added logic to a string of improbabilities. Those weren’t miracles happening at Nationals Park the past 10 days. It was the accumulation of applied pressure.

The Nationals tested their capacity to invent ways to win for the past two weeks. Sunday afternoon, they expanded their imagination yet again, eschewing a miracle for brute force. One after another, like an insidious assembly line, Nationals hitters laced baseballs to every corner of the stadium, until they turned a five-run deficit into a 14-6 show of force against the San Francisco Giants.

The Nationals fell into a five-run hole behind Stephen Strasburg in three innings, before recording a hit, and then smashed the Giants by a 14-1 margin over the last six innings. Their charge required the most remarkable inning of a remarkable two weeks, a six-run, eight-hit sixth started by Ian Desmond’s homer and powered by everyone else.

“That was one of the best games that I’ve ever played,” catcher Jose Lobaton said. “The way that we came back, that was unbelievable.”

The Nationals finished their 9-1 stay at Nationals Park with two high-water marks: eight games ahead in the National League East and 21 games over .500. They have won 12 of 13 games, including five walk-offs in a span of six days and Sunday’s deficit-turned-rout.

“I’ve never seen anything like it,” Scott Hairston said. “I think it’s safe to say nobody has.”

It was a moment after Sunday’s comeback, not during it, that illustrated how the Nationals have ascended to the top of the National League. Ahead three runs in the eighth inning, Jayson Werth took reliever Juan Gutierrez’s fastball under his chin as he worked an 11-pitch walk. He stole second base. He scored on a single. The Nationals poured on runs. The score had been irrelevant to the Nationals’ pursuit of applying pressure.

“The guys have done a great job over the course of the season not giving away at-bats and being tough outs, putting pressure on the opposing pitcher and the defense,” Strasburg said. “Put enough pressure on them, they crack.”

Before the inning ended, Bryce Harper hit a rocket off the right field foul pole and Danny Espinosa just missed the extra deck for a pair of two-run homers. The Nationals stretched the lead to eight. As the deficit had not daunted them, the lead had not satisfied.

“I think it’s just the competitive attitude of not wanting to lose at anything,” Craig Stammen said. “The game kind of takes care of itself, the score of that. It’s not wanting to lose a certain pitch or a certain at-bat. That competitiveness, that want to succeed, it’s a lot of little things that adds up to a big thing.”

Which National contributed most to the comeback? How about all of them? Werth went 2 for 4 with that 11-pitch walk, scored two runs and drove in the go-ahead run. Desmond sparked the rally with a solo home run, his team-leading 21st this season. Hairston roped a game-tying double into the left field corner.

Before the Nationals’ onslaught, Strasburg’s season-long oscillation between dominant and dreadful continued. Strasburg had allowed one earned run in 15 innings over his past two starts, but Sunday he allowed five runs on eight hits, including home runs to light-hitting Giants Gregor Blanco and Travis Ishikawa, in four innings.

Strasburg exited for a pinch hitter in the fourth inning, startled by coaches as he took a step toward home from the on-deck circle. By that point, Werth, Adam LaRoche and Asdrubal Cabrera had cracked doubles off Giants starter Ryan Vogelsong to slice the deficit to 5-2.

The Giants stretched their lead to 6-2 in the sixth on Hunter Pence’s sacrifice fly off Stammen. Down four runs with 12 outs left, the Nationals could have accepted an 8-2 homestand. They have grown accustomed to ignoring those thoughts.

“It just seems if we win a game normally, it’s kind of boring,” Stammen said. “The breaks are kind of going our way right now. We’re smart enough to know it’s not always going to be this easy and go this well. But we haven’t changed what we talked about the beginning of the year, just playing hard and working every day.”

Desmond launched the Nationals’ comeback. With one out in the sixth, he slammed a solo home run over the visitors bullpen in left field and knocked out Vogelsong. Giants Manager Bruce Bochy summoned side-winding left-hander Jeremy Affeldt, who entered with a 1.94 ERA.

“He’s been really good all year, according to his numbers,” Hairston said. “We didn’t pay too much attention to that.”

Affeldt faced Harper with the bases empty. After Harper buckled on a first-pitch curve, he roped a fastball to left field, which was occupied by old friend Michael Morse. Harper’s liner would have been caught by many left fielders. Morse chased it like he was running in peanut butter. The ball skipped off the fence for a double.

“Then the dominoes just started falling,” Harper said.

Cabrera singled, the third time he reached base. Harper scored on Affeldt’s wild pitch, igniting the crowd. Lobaton singled home Cabrera. Suddenly, the Nationals trailed by a run.

“I think early in the year, we were pressing a lot,” Hairston said. “All of us were really trying to do too much. But I think that time has passed. We’re focused on having good at-bats no matter if we’re up by five or down by 10. We just keep going.”

Hairston smashed a double that pinballed in the left field corner. As Morse played Hacky Sack, Lobaton darted home to score the tying run. Denard Span kept the hits flowing with a single off the plate, knocking Affeldt out of the game. Span endangered the rally by getting picked off. The Nationals shrugged. Anthony Rendon walked and Werth followed with a sweet-as-you-please line drive single to center field, scoring Hairston with the go-ahead run.

“It’s situational hitting,” Manager Matt Williams said. “He’s really good at that. He’s really good at understanding the situation, what it calls for, and having an approach and a plan to do that, whatever that is.”

In the dugout, players rushed to the railing. Tanner Roark and Doug Fister flapped their right arms over their heads, mimicking the way Werth reminds himself to stay down on the ball before an at-bat. Harper balled his fists and roared in joy.

They packed for a 10-day, nine-game road swing to Philadelphia, Seattle and Los Angeles, a test that will go a long way to determining their playoff chances. When they return home, with a cadre of September call-ups in tow, only 24 games will remain. Their homestand, so improbable, had put them in control, in position to play beyond.

“It was some hairy times and some not-planned moments,” Williams said. “But they just keep going.”