Cats can smell with their nose but also (like snakes) with the so called the vomeronasal organ (VNO), or the Jacobson’s organ, that is inside the mouth, just behind the front teeth, and connects to the nasal cavity.
The vomeronasal organ is mainly used to detect pheromones, chemical messengers that carry information between individuals of the same species.
This is the reason why cats open their mouths after they smell something: cats use a distinctive facial movement called the flehmen response to direct inhaled compounds to this organ. The cat will lift its head after finding the odorant, wrinkle its nose while lifting its lips, and cease to breathe momentarily. Opening the mouth heightens the experience of smelling.