Paul M. Sutter is an astrophysicist at SUNY Stony Brook and the Flatiron Institute, host of Ask a Spaceman and Space Radio , and author of " Your Place in the Universe. " Sutter contributed this article to Space.com's Expert Voices: Op-Ed & Insights .

It's a dangerous universe out there, and life on any planet faces numerous existential threats — including the possibility of the planet getting kicked out of its solar system altogether. One team of researchers ran the numbers and found that the Earth is safe from such a catastrophe — almost.

Related: Earth quiz: Do you really know your planet?

One swift kick

Gravity can be a tricky thing. One moment, it's holding a planet in orbit around a star, safely chained to that life-giving warmth for billions of years. The next, that very same gravity is sending the planet hurtling into the depths of interstellar space, doomed to wander the frozen wastelands of our galaxy, with any life on that planet quickly and permanently erased.

Gravity is so tricky because it's actually rather complex. When there are just two objects — say, a massive star and a single little planet — the math is easy to work out. Once a planet finds itself in a stable orbit, it will remain in place for billions upon billions of years without deviation, the regular rhythms of its motion repeating like the gears of a great clockwork mechanism.

But throw a third object into the mix? Anything goes — chaos. As in, literal chaos. The problem of trying to predict the motion of three objects interacting through gravity has been notorious for centuries, with intellectual heavyweights through the ages trying to come up with a solution and failing. The problem is that with three objects, any little deviation or shift can lead to massive changes in a surprisingly short amount of time.

In other words, what looks calm, cool and collected one moment — say, the fact that the Earth has orbited the sun placidly for billions of years — can become dangerously unstable the next.

But so far, so good, right? The rest of the planets in the solar system are relatively small, and while they do tweak and affect the Earth's orbit in subtle ways, they don't cause outright havoc and general destabilization. Things will be just fine for billions of years to come, as long as nothing massive — say, a passing star — comes close.

Related: Our solar system: A photo tour of the planets

The danger zone

But sometimes neighboring stars do come close to our solar system, and when they get too close, it's nasty.

As a star nears the solar system, it can start to change the orbit of the Earth. When the Earth and the interloper are near, our planet can get a little bit of energy, a gentle gravitational tug-of-the-leash from the foreign visitor. This may not amount to much, but if this happens year after year, the Earth can steadily gain energy, moving its position farther away from the sun, out of the " habitable zone ," the band of orbits around the sun that aren't too close for surface water to vaporize or too far for it to turn to ice.

And with enough tugs, the Earth could potentially gain so much energy that it achieves escape velocity from the sun, leaving the solar system in the blink of a cosmic eye.

Thankfully, this scenario hasn't happened in the past four billion years (obviously, because we're still here), but that doesn't mean it couldn't happen in our future. Recently, a pair of astronomers set about simulating the effects of a passing star on the orbit of the Earth, reporting their results in a paper appearing on the preprint journal arXiv .

They looked at all potential scenarios: different masses of stars incoming at all sorts of angles with all sorts of speeds, to see what circumstances could potentially move us out of the habitable zone — and end life on our planet as we know it.

Generally, the faster the star blows through our solar system, the better it is for us; for a star in a hurry, there just isn't enough time to really mess things up gravitationally. If the star is moving at least as quickly as the Earth orbits the sun (a little over 66,000 mph, or 106,000 km/h), then it has to pass within the orbit of Jupiter to have a decent chance of knocking us from our orbit; otherwise, its gravitational influence is just too inconsequential. But slow-moving stars can cause much more trouble: they only have to skirt the edges of the solar system to cause carnage.

Naturally, the mass of the passing star is critical, as well as the angle of impact. If the star is passing along the plane of our solar system, it has a lot of chances to get near enough to the Earth to destabilize us, and if the star comes within twice the distance of Earth's orbit around the sun, regardless of other factors, we're simply toast.

I'm a survivor

The researchers then took these results and applied them to our galactic neighborhood, using our knowledge of the positions, masses, and velocities of the stars nearest to us. They found that, on average, our planet only had a 1/15,000 chance of orbital destabilization over the course of our 4-billion-year history. In other words, for every 10,000 Earth-like planets in our neighborhood, only one has suffered a disaster.

But things get much worse in the busy, compact central bulge of the Milky Way . With all those stars, the chance of gravitational catastrophe is 160 times higher.

Generally, that's pretty safe. But it does inform searches for life on distant exoplanets. The center of a galaxy is a generally unfriendly place, a hotbed of high-energy radiation and cosmic rays. And now we know it's also full of potentially deadly close calls between stars, close enough to knock life-bearing worlds out of their orbits. If life has managed to arise on any of the worlds there, it's in for a tough time.

Read more: " Dangerous stellar encounters with an Earth-like planet in the Milky Way galaxy "