I didn't even notice you edited that xD
To be honest, there really isn't any logical explanation for that. Even a bird that's on the ground will shake when mother earth is mad. The only explanation I can think of, that doesn't even makes sense, is that non grounded targets have some sort of aura or magic or whatever that protects them from the earth itself. Something like an innate ability which the move gravity completely removes for whatever reason. Although if someone asks gamefreak they would say 'hey we made this game. We can do whatever we want and you'll still buy it'