To elaborate on what Don has above....
Vacuum leaks (unmetered air entering the intake system) can be a real problem.
By spraying around areas that may be leaking - you are interrupting the possible inflow of air by sucking in a bit of 'fuel' instead.
The engine then (momentarily) runs different (usually better) and you get feedback on where the problem area is.
This method also works on carb engines also (including seeing if the throttle shafts leak or carb base is warped/gapped - each allowing in air).