Gravity ends in -ity, the standard Latin abstract-noun suffix in English, and it came in about 1500 both through Old French gravité and directly from Latin gravitatem, from gravis, "heavy." The word arrived carrying the metaphorical sense first: weight in the sense of dignity, seriousness, solemnity of character. Only in the 1620s was it applied to the literal downward pull.
That order is the opposite of what you might expect, and it is common in borrowed Latin vocabulary — English takes the figurative use from books and then reclaims the physical sense when it needs a technical term. The Century Dictionary drew a careful line the language has since blurred: gravitation for the attracting force, gravity for the terrestrial phenomenon of weight. The Sanskrit-derived guru, from a root also meaning "heavy," is a distant cousin: both a weighty person and a weighty planet come from the same idea.
gravity (n.) c. 1500, "weight, dignity, seriousness, solemnity of deportment or character, importance," from Old French gravité "seriousness, thoughtfulness" (13c.) and directly from Latin gravitatem (nominative gravitas ) "weight, heaviness, pressure," from gravis "heavy" (from PIE root *gwere- (1) "heavy"). The scientific sense of "downward acceleration of terrestrial bodies due to gravitation of the Earth" first recorded 1620s. The words gravity and gravitation have been more or less confounded; but the most careful writers use gravitation for the attracting force, and gravity for the terrestrial phenomenon of weight or downward acceleration which has for its two components the gravitation and the centrifugal force. [Century Dictionary, 1902] also from c. 1500
gravity came in through Latin, and its spelling follows that family's conventions.
How that family writes these sounds
| the abstract endings | -tion/-sion, -ity, -ous, -ate, -al, -ive, -arynation, gravity, various, create, legal, active |
What gives it away on the page
| -tion/-sion, -ity, -ous, -ate, -al, -ive, -ary | The standard Latin suffix set, usually stacked on a Latin root.nation, gravity, various, create, legal, active |
Placing it without the spelling
| abstraction, law, administration — words written before they're spoken | Latinnation, gravity, various, accept |