Substances smell because your nose (or olfactory system) is able to detect the volatile molecules that are being released. Your nose has roughly 350 different receptors that detect molecules and then send a signal up through various parts of your olfactory system, ultimately ending up in your brain. A smell doesn’t come from a single receptor firing off a signal, but rather a whole array of receptors. Your brain takes the combination of signals it receives and translates that into the perception of the odor.
Receptors in your nose detect molecules in the air, sending signals to your olfactory nerve, which then transmits the signals to your brain, which interprets them as smells.