What this little device does is mistaken by many people, like the governor, so I will explain its purpose and how it works.
The correct term is the "Anti-Afterfire Solenoid". It does exactly that, prevents "afterfiring" when the engine is cut off. This is not to be confused with backfiring, which is a totally different thing. Afterfiring is that loud bang you hear after cutting off a tractor engine. This condition is more popular in Briggs and Stratton engines than any other engine. The loud bang is totally harmless to the engine, but can be scarry or annoying to the operator.
What causes the "afterfiring" is raw fuel touching the hot internal parts of the muffler. How this works is when you cut off the engine after mowing the grass, the engine "coasts" to a stop (keeps spinning until it slows down and stops). When the engine is coasting, the fuel is still being drawn into the cylinder on the intake stroke, compressed on the compression stroke, and exhausted on the exhaust stroke. The key here is the fact that the fuel is not combusted under the compression stroke (as it would be when the engine is on). The fuel takes a ride through the engine and ends up in the muffler. When this raw, unburned fuel hits the muffler, it explodes (like it would during the compression stroke). The fuel continually "rides" through the engine until it stops coasting. By the time the engine stops, there may be four or five compression stroke's worth of fuel in the muffler, ready to blow up.
Now the job of the solenoid is to prevent this from happening. It is a very simple, yet expensive part. It works with electromagnatism and a spring. The spring constantly keeps the metal pintle (finger) in the extended position until the ignition switch is turned on. When the swtich is on, 12 volts is supplied to the solenoid, which makes the electromagnet pull down on the pintle. When the switch is off, the spring automatically returns the pintle to the extended position. If you have seen an IAC valve on a car, you will have an idea of what I am talking about.
When you have the solenoid installed on the bottom of the carburetor and turn off the engine, the spring pushes up on the pintle. This pintle actually blocks the main nozzle, preventing fuel from being sucked up through it when the engine is coasting to a stop, thus preventing the loud bang noise when the engine stops.
If you don't have this solenoid, you can prevent the afterfire noise by slowing the engine down to idle and let it cool off for about 30 seconds. This will give the muffler a chance too cool.
It is possible for the engine to still afterfire if you do have the solenoid. To correct this problem, cut the engine off in fast. DO NOT IDLE DOWN.