Once your brain has been given a new scent and registered it as a memory, coming into contact with it again may remind you of the first encounter, especially after many repeated exposures. This is why we may get hungry when we smell food cooking or leave the room when there's an unpleasant scent. More importantly, however, this allows us to associate long-term memories with scents, often causing certain scents to be our favorites.
Here, we need to examine the brain as well as the nose. Explicit memory, which encompasses memories of sights, sounds, experiences, and the like, is stored in a part of the brain called the hippocampus. At the same time, the limbic system handles emotional responses and instinctual reactions to these memories. As they are closely linked, the limbic system often carries an emotional memory, where the emotions one felt during a particular experience are felt once more when that experience is recalled.
Our brains are designed to recognize patterns, and though its original purpose was likely a survival instinct, it now serves as the driving force behind our likes and dislikes in general. When we undergo specific experiences that we associate with a smell, we may form an opinion of that smell based on the positivity or negativity of that experience. The result of this is a conditioning of sorts. A smell causes memories to be recalled, and those recollections can cause an emotional response. After numerous exposures, recollections, and responses, we often associate emotions with the scent itself, firmly cementing the emotional reaction in our minds.