As I understand it gravity is a product of mass. And so the trick of any artificial gravity system (with the exception of centrifugal force which isn't actually gravity) is to create the effect of mass yet without the actual mass. If you want a 1g gravity field then you have to replicate an Earth equivalent in planetary mass yet without the planet.
We could well be talking about some manner of exotic matter here. Or possibly exotic energy. For an artificial gravity system you don't actually have to have a gravity field pulling you down at 1g--you could just as easily have a negative gravity field pushing you down
Candidly I've come to believe that with the examples of gravity manipulation we've seen in TOS it wouldn't surprise if both the impulse drive and the tractor beam as well as deflector beams are actually forms of gravity manipulation at work. Note the impulse engines only appear to face rearward and yet we've seen the ship put into reverse on impulse--how can that be if the impulse engines are strictly a form of reaction drive? But a gravity drive or even better a negative gravity
drive could push the ship in any direction. Indeed this is actually the very kind of stardrive I've adopted for my own original fast relativistic starship design.