In cooked food, the particles of matter absorb heat and turn into gaseous state and mix with atmospheric air. So the smell of food reaches our nostrils without our entering the kitchen through air.
There is another example for this fact. When we light an incense stick, its smell reaches our nostrils even if we are away from it. But when it is not lighted, we don't get the smell.
Hope it helps... if it does, thumbs up please!