The strongest hurricane ever recorded in the Western Hemisphere hit Mexico's Pacific coast late last week, and despite threatening several densely populated port cities with winds travelling at up 321 km/h (200 miles/hour), the death toll sits at just six individuals

Having made its way through the warm waters of the Pacific Ocean, Hurricane Patricia worked its way up into a Category 5 storm and made a menacing beeline for the coast of Mexico last Friday night. But just 12 hours after making contact with land, Patricia effectively petered out, with reports that by 4pm Saturday, it no longer even ranked as a tropical storm. 

So what happened? If you keep up with the news, it's easy to think the world is going to hell, with war, corruption, global warming, and poverty knocking at every single person's door to some degree. But as Swedish statistician Hans Rosling has told us time and again: things aren't as bad as you think. Fast population growth has stalled, people are healthier than ever, girls have access to education, and the end of poverty is in sight.

And now we're finally seeing the result of decades of research into predicting hurricane behaviour that's allowed the Mexican local to deal with the threat of Hurricane Patricia better than could ever be expected. As Brad Plumer points out at Vox, "A similar-size typhoon hit the Philippines in 2013 and killed more than 6,300 people."

So how did Mexico avoid such a heavy death toll this time around? Experts have been putting it down to excellent preparation, and the unusually fortuitous behaviour of the storm itself.

The hurricane put to the test the reaction of all three levels of government," Ricardo Aleman reported for the El Universal newspaper on Sunday. "And unlike many other occasions, the coordination [this time around] was almost perfect."

Referring to the magnitude 8 earthquake that hit Mexico in September 1985, which caused the death of thousands, and the more recent combination of Tropical Storm Manuel and Hurricane Ingrid in 2013, which killed at least 120 people, Aleman isn't the only local to give credit to past disasters for the country's "almost perfect" reaction to Patricia. "Each of these episodes that we've experienced has allowed us each time to improve our system of civil protection," Mexican President Enrique Peña Nieto told reporters over the weekend.

One reason for such minimal fatalities is that the locals took the official government warnings seriously, with tens of thousands of residents evacuating, and more than 1,200 temporary shelters being established in safe areas in response to warnings on television and radio broadcasts and officials taking to the streets with their loudspeakers. 

"Schools shut down, stores and businesses closed and people heeded the advisories to stay indoors or move to shelters," The New York Times reports. "When trees and lampposts fell, there was nobody outside who could be hurt. 'The final result is a recognition that everybody paid attention,' Puente said."

The other reason, which was completely out of everyone's hands, was that not only did Hurricane Patricia lose a great deal of force once it got close to the Mexican coast, it just so happened to change its path away from the densely populated cities and ended up hitting one of the least populated areas on Mexico's Pacific coast - an eco-resort near Cuixmala, surrounded by an ocean reserve. "Had the storm veered just a little bit farther north (toward the tourist hub of Puerto Vallarta, population 250,000) or a little bit farther south (toward Manzanillo, population 150,000), it could have been much deadlier," Plumber writes for Vox. 

There's also the fact that because the hurricane developed so incredibly fast, the span of the whole thing was relatively small, measuring just 24 km (15 miles) from the eye.

To be clear though, for those affected by the storm, few might have lost their lives, but the devastation left in the wake of the storm is very real. Mexico is reporting that between 3,000 and 3,500 homes have been damaged or destroyed, and 19,000 acres of crops have been lost, which will cost the country, and its locals, millions of dollars into the future. But things could have been a whole lot worse.

"Yesterday, there was lots of water and wind," 23-year-old local, Anna Jáuregui, told The Times. "Today, all you see is sun."