If the engine is revving *without* the gas pedal being pressed, that's a problem indicating a malfunction somewhere in the throttle system or possibly the engine control unit (ECU). Potential causes of a problem (opposite of your description) could include:
* Faulty Throttle Position Sensor (TPS): This sensor tells the ECU the throttle's position. A faulty TPS could send incorrect signals, causing the engine to rev unexpectedly.
* Stuck Throttle Plate: The throttle plate itself might be sticking slightly open, allowing more air in than intended.
* Vacuum Leak: A leak in the vacuum system can affect the throttle control.
* Faulty Idle Air Control (IAC) Valve: This valve regulates air flow at idle. A malfunction could lead to high idle.
* Faulty ECU: While less common, a problem with the engine's computer could cause erratic behavior.
Since your question describes the *normal* operation of the engine, there's no problem to diagnose. If you were experiencing the opposite—the engine revving without gas—then investigating the above would be necessary.