The engine is receiving more gas than it can consume. Sometimes the carburetor needle valve will vibrate to the open position or the float valve will stick open. Also, a fouled spark plug will not provide sufficient spark to ignite the fuel. Check out a lawn mowers and small engines repair manual from your public library for troubleshooting and repair procedures.
Lean Misfire
The most common cause of engine surging (rev up and down) is a dirty air filter.
Generally the most common problems with these engines is fuel-related, though ignition can be a problem if the blade has struck something shearing the key.
the valves or rings are allowing compression blow by to enter the crankcase which causes excess pressure that is brought to the carburetor by the breather tube. your engine is getting tired or you have too much oil in the crankcase.
The most common cause of surging is a dirty air filter. EPA approved carbs tend to run lean causing the surge condition described. Main jet needs to be replaced with next size larger.
Time for an IGNITION switch
one reason for this is the air inlet on the petrol cap is blocked or too small causing a vacuum in the petrol tank and starving the motor.
Answer Can be a clogged fuel filter, or possibly a fuel pump going bad. Replace the filter and see if this fixes the problem. Also, be sure the fuel tank is properly vented and/or the vent in the fuel cap is not plugged with dirt.
The rocker arm clearance tends to loosen in these engines. This causes too much compression at the wrong time resulting in hard starting. Most people think the battery is weak but a relatively simple adjustment of the valve/rocker arm clearance should solve your problem. Check your manual and YouTube for instructions or consult your local mower shop.
Its out of gas
The carburetor float may be stuck in the open position and allowing fuel to seep through the carburetor into the intake and into the cylinder. The needle may also not be seating correctly , check the float the check to make sure the needle is seated properly.
could be a broken valve. or a loose spark plug..