First off, let me explain the graph you are about to see. There's a cool little tool called fangraphs that calculate a baseball team's chances of winning at any point in the game. As you can see from the graph below, it starts at 50/50 at the beginning of the game all the way on the left side. And because the Nationals looked absolutely horrible for most of the night, it just went downhill from there.
But check out that ninth inning. You can see the initial spike in the bottom of the inning from Werth and Bernadina getting on base. Then the double play from Zimmerman knocks it back down to zero. But a few rbi singles later, and the Nationals still had less than a 10% chance to win this game. I mean, you gotta figure that most teams down two runs with two outs in the ninth lose; even with a couple men on base.
But then comes Wilson Ramos. His home run is that yellow line shooting skyward. It's just about the biggest increase a single play can have on the potential outcome of a game; +91.3% according to our Federal Baseball. So there you have it, a mathematical explanation of a walk off home run.