They are on good terms with us, but not formal allies, which leads to: The Russians assessed, correctly, that we would not intervene (militarily, at least) on the Georgians' behalf.
The Georgians knew this, which is why they had tried so hard in the proceeding year to get into NATO.
To this day, the US is willing to deploy troops for lots of reasons--sometimes to protect allies, sometimes in response to humanitarian issues (Yugoslavia)--but never in a situation where they will get into a shooting war with Russia or China. And the tendency is reciprocal. When Russia sends troops into Georgia, they do so knowing the US will not send their own troops to Georgia. When the US sails a half dozen aircraft carriers through the Taiwan Straits, as they did in 1996, they do so knowing China will not cross that line and attack Taiwan, as they were threatening to do at the time.
"Dear Vladimir and Dmitri,
We are absolutely unwilling to risk war in defense of Georgia.
Sincerely, NATO."
The great irony is that, by taking steps intended to stave off a Russian invasion, the Georgians instead opened the door for one. If they had instead played a slower and more cautious game, they might have maintained sufficient ambiguity and doubt to keep the Russians out. Maybe. Or not. I'm also playing Monday morning quarterback here, so I can't really blame them for trying.
What they didn't know was that the Russians had already moved several brigades through the tunnel and controlled both sides of it before the fighting in South Ossetia started. But, hey, maybe it really was pure coincidence that those two things happened in that order, in rapid succession.
If you are a U.S. ally, you are unlikely to be invaded by the U.S. (kinda goes without saying, and you can insert pretty much any country you like in place of U.S. and the sentence remains true).
If you are a U.S. ally, what are your odds of being invaded by someone other than the U.S.? Very low. Why? For the same reason that your leader would call the U.S. if you were invaded. What if you're not in a formal alliance with the U.S.? Odds are still pretty good that any potential aggressor will, before planning an attack, ask himself, "Will the U.S. intervene if I invade my neighbor?" If the answer is "yes," he probably won't invade. Keep in mind that the U.S. has fought wars because someone figured, incorrectly, that the answer was "no."
OK, what if you're not at all friendly with the U.S.? In this case, there are a lot of other factors that come into play. Are you a peer power? If not, have you aligned yourself with such a power? If so, how much are you worth to them? How about nukes, do you have nukes? If not, can you fake it credibly? Are you generally belligerent and aggressive, or do you mostly mind your own business? Keep in mind, these questions aren't just factors in determining your chances of being invaded by the U.S., they are factors in determining your chances of being invaded by anyone at all.
Summary: if your chances of being invaded are very low, it's most likely because of the existence of the U.S. military. If that's not the reason, it's because you have a comparable military, or have aligned yourself with somebody who does. If you're not on good terms with the U.S. you're in a more precarious position not just because the U.S. might invade you, but also because everyone else knows that the U.S. won't intervene on your behalf. If you have nukes, only crazy people will invade you, unless you act so crazy that the sane countries decide that it's worth the risk to try and take them away, since you'll probably use them sooner or later anyway.