Trek impulse engines are supposed to be essentially fusion rockets, which use exhaust to provide thrust like the rocket engines we have today, just much more efficiently. The exhaust from these engines was a critical plot point for Star Trek VI.
However, there's zero way hypothetical fusion rockets, as we understand them, would work the way they show on the show, so there has to be some kind of warp effect or magical inertia modification fuckery tech in play as well. The lore is inconsistent on exactly how this is supposed to work.