Scent allows you to detect enemies that try to sneak up on you in more cases than you would hear.
Because most creatures have hearing (Pathfinder seems to assume that all creatures do so unless they say otherwise) many creatures will attempt to move silently using Stealth.
Scent avoids these stealth attempts (which allows you to be aware of them) unless they have taken steps to prevent your Scent from working. A creature that knows you (form r) has a smell can do it, but many other creatures will not know or simply do not have the means to mask its smell.
Notably, the smell is typically a meaning of vague sense
In the best case, a vague sense can be used to detect the presence of an inadvertent creature, so it is not detected.
While updating this to inaccurate allows
Usually, you can feel a creature automatically with an imprecise sense, but it has the hidden condition instead of the observed condition. That could not be detected …
Mechanically, this ignores Not detected; Inadvertent is the most extreme version of Undetected that would allow creatures to really take advantage of you (potentially as dangerous assassination attempts with future content releases), while Undetected is almost as bad.
If a creature does not notice it, that creature has no idea that you are present. When you go unnoticed, the creature does not detect you either. This condition is important for skills that can be used only against targets that completely ignore your presence.
When you are not detected by a creature, that creature cannot see you at all, has no idea what space you occupy and cannot attack you, although you may still be affected by
skills that point to an area …
While you are hiding from a creature, that creature knows the space you are in but cannot say precisely where you are … A creature you are hiding from is flat, and must succeed at a time DC 11 flat check when you attack with an attack,
the spell or other effect or failure affects you.
Notably, any ally that reduces an enemy to Hidden allows everyone to treat them as Hidden because you effectively know what space the target occupies. Being the one with the scent gives you the advantage to allow your group to counter an ambush.
A note on how to hide from Scent.
It seems that there is margin in the sidebar on p465, which implies that you can usually try to hide from the senses, including Scent, with the proper narration (maybe cover yourself with mud, etc.); however, the Foil Sense skill ability allows creatures to defeat Scent without preparing specifically for it. Fortunately, it requires Master in Stealth, so few creatures will run with that ability.
The Stealth skill is designed to use Hide to avoid visual detection and Avoid warning and sneak in to avoid being seen and heard. For many special senses, a player can describe how they are avoiding being detected by that special sense and use the most applicable stealth action. For example, a creature that treads lightly to avoid being detected by Tremorsense would be using Sneak.
Based on this, some GM (including myself) would instead ask for a costume or a survival roll, if the task in question was to cover themselves with mud to overcome their smell.