The thalamus is a part of the brain that is between the cerebral cortex and the midbrain. One of the functions of the thalamus is to process sensory information and send it to the appropriate part of the cortex. For example, visual information comes from the retina, goes to the thalamus and then gets routed to the primary visual cortex. All of the senses send their data to the thalamus before the information goes anywhere else, with the exception of smell. The olfactory system does not go through the thalamus. When you smell something, that sensory data goes right to your amygdala. The amygdala is where emotional information is processed. This is why people react emotionally to smells: You smell a flower and it makes you happy. You smell rotten meat and it makes you feel disgusted. The amygdala is right next to the memory centers of the brain. This is also why you can smell something and have memories invoked.

https://www.blog.theteamw.com/2011/03/01/100-things-you-should-know-about-people-68-smells-evoke-emotions-and-memories-2/