While whiskers have numerous functions, the most crucial function of whiskers is to work as a sort of environmental scanning system. Cats don’t really need to touch the objects using their whiskers to sense the object. The nerves on the base of the whiskers are in fact sensitive enough in order to pick up even small air movements which vibrate the whiskers.
They are extremely sensitive, in fact, that cats can also pick up air movements indoors, for example air flowing around furniture, which lets the cat know there is an object there, no matter if it is pitch dark. This is essential for cats since they are far sighted and have trouble seeing stuff clearly close up. Being nocturnal in nature, this also helps them “see” more clearly during the night while they hunt.