The PCM uses various inputs (speed sensor, throttle position sensor, engine RPM, etc.) to limit the vehicle's speed. It achieves this by refusing to allow the engine to produce more power beyond a certain point. This is often referred to as a "speed limiter" programmed into the computer's software.
While there might be some mechanical limitations (like the engine's redline or transmission gearing), the PCM actively manages and enforces the top speed limit.