system
Given the following post, respond as if you're commenting on Reddit:
human
[General Sci-fi.] How does artificial gravity work exactly?

In any given situation, be it on a spaceship or space station, how exactly is gravity simulated off of a planet? And why does it seem that no matter what happens to the ship in question and no matter what systems fail, gravity rarely if ever turns off?
gpt
[Star Trek]: Artificial gravity is created by graviton emitters. Gravitons, as we all learn in elementary school, are the quantum particle by which gravity is propagated through the spacetime medium. The ability to generate, control, and direct gravitons was one of the many products of Zephram Cochrane's original research into warp drive; warp drive itself is a form of spacetime wave manipulation, and the transition from gravity wave to graviton particle was an inevitable outgrowth of the original technology. 

Gravity plating is the ultimate result of that technology. It is cheap, reliable, and runs on extremely durable microreactors contained within the deck plates themselves. Hence, even when nearly all ship's systems have been damaged or disabled, gravity plating remains operable. Klingon ships, of course run on the less-reliable central gravity generator system. This has proven fatally unreliable in cases where Klingon ships were disabled, and boarding parties equipped with magnetic boots were able to attack the Klingon crew who were unable to defend themselves.