Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

A hurricane's track is critical: Even a small deviation from its projected path can make a big difference in the destruction left behind from wind and water.

So, when Hurricane Irma took a last-minute detour inland as it churned up the west coast of Florida, many communities were spared the worst-case scenario — all thanks to a tiny budge east.

There's no doubt Irma was devastating: It cut power to millions, killed 40 people across the Caribbean and southeastern United States, and caused record-setting floods in Jacksonville, Florida.

People explore storm surge flood waters from Hurricane Irma along the St. Johns River at Memorial Park on Sept. 11, 2017 in Jacksonville, Florida. Sean Rayford / Getty Images

But if there's any silver lining, it's that Irma's storm surge was not as bad as many feared it would be.

"Storm surge is very, very sensitive to the exact track and characteristics of a storm, to the point where even the smallest change can have ramifications of ten or more feet," said Jamie Rhome, a storm surge specialist with the National Hurricane Center. "If the track moves just a little bit, it can change the storm surge significantly."

Related: Floridians Take Stock and Begin Recovery as Hurricane Irma Exits

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

While some areas, particularly Marco Island on the Gulf Coast and the Florida Keys to the south, were hard-hit, areas to the north like Naples, Sarasota, and Tampa Bay escaped projected storm surge totals of 12 feet or more. Those cities still ended up getting flooding, but nothing close to what they were bracing for.

"This is a blessing," Sarasota Mayor Shelli Freeland Eddie said Monday. "This is horrible, but it could have been much worse. We were expecting heavy flooding, we were expecting communities demolished."

The reason for the dodged bullet has to do with the structure of a hurricane, which contains the strongest winds in its eastern wall. By the time Irma got to Naples, it had strayed farther inland than expected, taking its powerful eastern wall away from the water.

Related: Irma Winds Down, Leaving a Trail of Destruction and Broken Records

"What happened is Irma made a very subtle wobble to the east, which spared Naples and points northward the worst of the surge," Rhome said.

But, he added: "It certainly didn't spare them the worst of the wind."

Yet even the wind wasn't as bad as meteorologists feared it could be. That's because hurricanes have a tough time maintaining their strength once they're no longer over water, NBC News meteorologist Sherri Pugh noted.

"Once they hit land, that friction really helps to weaken them and to disrupt their structure," Pugh said. "Not staying in the Gulf really contributed to the weakening of Irma."

Even the storm surge after the hurricane passed wasn't as bad as expected. One of the most curious sights left behind by Irma was drained shorelines along the Gulf Coast, due in part to the storm's winds being aligned parallel to the shore.

The Tampa skyline is seen in the background as local residents Rony Ordonez, left, Jean Dejesus and Henry Gallego take photographs after walking into Hillsborough Bay while awaiting the hurricane's arrival in Tampa on Sept. 10. Adrees Latif / Reuters

The National Weather Service in Miami warned those taking pictures of the strikingly dry beaches that the water, which had been sucked inward toward the ocean, would eventually return and "rapidly rise in a matter of minutes."

"MOVE AWAY FROM THE WATER! Life-threatening storm surge inundation of 10 to 15 feet above ground level is expected in this area," the agency tweeted.

That didn't happen either, though. The reason, once again, was Irma's path.

"It's partly the orientation and also because it came onshore a little earlier and didn't stay in the Gulf as long," Pugh said. "It weakened a bit, helping to make that storm surge not quite as devastating."

The experts say it wouldn't have taken much movement for the rest of Florida to see the same deluge as the worst-off areas.

"You would probably only have to move the center 10 or 15 miles to the west of where it made landfall to produce the huge storm surges that we saw from Marco eastward," Rhome said.