For what it’s worth, in the novelization, Poe sets a hyperspace entry point before Leia and Holdo retake command of the ship. That entry point is never changed, so when Holdo is alone on the ship waiting to die, she notices it - and because the ships have kept moving that whole time, the entry point is now behind the First Order fleet. That’s what gives her the idea to try it - because the ship will be accelerating to near lightspeed prior to hitting the hyperspace entry point.
So the “hyperspace ramming” actually occurs before the ship enters hyperspace, while the ship is accelerating to near-lightspeed in realspace.
It was basically her seeing where the entry point was plotted in relation to the position of the fleet, getting the idea, and going “Huh, wonder if this will work? Can’t hurt to try since I’m dead at this point anyway.”