Many lawnmowers use a plastic vane under the engine shroud that interacts with air moving off fins on the flywheel to work as a speed control mechanism to open and close the carburetor throttle valve in response to the engine speed changing because of loading changes. Lawnmowers often operate in very dusty environments and the linkages associated with the vane assembly can get all gummed up or even stuffed up with dirt. This can lead to the surging type behavior that you are seeing.
The fix for this is to carefully disassemble part of the engine covering and give the vane mechanism and its linkages a good cleaning and re-lube.
Surging can also be caused by dirt particles entering the innards of the carburetor. Virtually all carburetors are equipped with some type of air filter to keep dirt out but sometimes dirt can get in anyway - especially when removing a dirty filter for replacement/cleaning.
The typical fix for that is a complete carburetor removal, dis-assembly, cleaning and reassembly. It is also necessary to fully clean the area where the carburetor mounts and connects to the engine. Any dirt left there can easily find its way into a nicely cleaned unit and set you back to square one. Note that these small engine carburetors can have many small parts that are easily lost so it is necessary to work in a clean area where parts can be found if they try to get away. It is also possible to take a carburetor to a small engine repair shop for servicing if you are leeiry about tackling it yourself.