If your vehicle is showing engine surges or rpms fluctuate without pressing the gas pedal, here are the most likely causes and the parts you'll need to fix each one.
Unmetered air is entering the engine past the sensors, causing the computer to constantly adjust fuel trims to compensate, resulting in a surging idle. This frequently happens if a vacuum hose is left disconnected or cracked after recent engine work.
Carbon buildup causes the valve that controls idle airflow to stick, making the engine hunt for the correct idle speed. This is highly common on older, cable-driven throttle systems.
Carbon buildup around the throttle plate restricts airflow. If the battery was recently disconnected or the throttle body cleaned without performing an electronic idle relearn procedure, the RPMs will surge erratically.
A contaminated MAF sensor incorrectly measures incoming air, causing the engine computer to deliver the wrong amount of fuel. This often happens if the sensor is bumped, contaminated with oil, or left unplugged during an air filter change.
A degrading oxygen sensor sends delayed or erratic exhaust readings to the computer, causing the engine to constantly overcorrect the air-fuel mixture and surge at idle or low speeds.
Worn internal contacts in the sensor send erratic throttle position signals to the computer, making it think you are rapidly pressing and releasing the gas pedal even when your foot is off it.
If the sensor randomly drops its temperature reading, the engine computer may suddenly enrich the fuel mixture and raise the idle speed, falsely thinking the engine has instantly become freezing cold.