Ships have inertial dampers, otherwise people would die when warping or even accelerating on impulse power.
Why then, do they stop working every time a torpedo or small rock hits the ship? They can handle everything from a 1 m/s^2 to warp 9.9 accelerations, but not movement induced by collisions?
WHAT UP WITH THAT?
It's the Plot Device. Every ship has one installed somewhere, but no one knows where to prevent engineers from removing them. Plot Devices are responsible for making something happen, for getting the ships and their crews into the most ridiculous situations caused by something completely harmless otherwise, but very dangerous, maybe even deadly when you include the technobabble, all in an attempt to make the show more interesting to watch and boost the ratings.
So, when the ship gets hit by something, computer automatically diverts auxiliary power to the Plot Device, making it do crazy things, like taking inertial dampeners offline to prevent our heroes from warping away to safety, causing "that last torpedo" to take Warp drive offline by hitting the part of the ship that has absolutely nothing to do with the Warp engines, magically deactivate Holodeck safety protocols while the most dangerous program in the database is running, locks Holodeck doors to prevent people inside from getting out to safety, dumbs down the entire engineering crew enough to make them try every possible and impossible method of shutting the Holodeck down and opening the door (plenty of technobabble included) except taking a pair of pliers and cutting the wires that feed power to the Holodeck, etc.
So yeah, it's the Plot Device. :D
Shut up Oban, we're not supposed to notice these things.