The vomeronasal organ or Jacobson's organ is a special organ inside the mouth on the palate. It can be found in all vertebrates but it is only enhanced in a few. In mammals we have lions (panthera leo) and certain deer species which use their Jacobson's organs during mating times. These animals will actual gape their mouths during mating season in an effort to smell the pheromones of a female.In the squamates, the main function of smell has been rerouted from the nose to the tongue. When a lizard or a snake wants to smell it's surroundings it will flick it's tongue out and gather the particles in the air. The tongue then returns to the mouth and the tips of the tongue are pushed up against the roof of the mouth where they must enter two pits in the roof. Since these pits are split apart from each other the tongue itself also has to split. This is why snakes have forked tongues.
The degree of the fork indicates the use of the organ. So a common iguana (Iguana iguana) with a very shallow fork doesn't use it's Jacobson's organ as much as a monitor lizard (Varanus) with it's deeply forked tongue.So the next time you see a snake sticking it's tongue out at you, remember it's sniffing the air, not trying to sting you.