It masks. A passive air freshener, like any air freshener, adds fragrance over an odor rather than removing its source. Odor eliminators are the products formulated to neutralize or absorb the source, using ingredients such as enzymes or activated charcoal, and fabric refreshers are made for soft furnishings rather than the air itself.
One that works without power or propellant, releasing fragrance gradually. Reed diffusers, gels, sachets, hanging cards and charcoal bags all fall into this group, and they suit small enclosed spaces such as wardrobes, cars and bathrooms.
They are sprayed onto the water surface before use, forming a thin scented film intended to trap odor beneath it. That is a different mechanism from spraying into the air afterwards, which is why the instructions specify before rather than after.
Unscented odor absorbers such as activated charcoal or baking-soda-based products, which work without adding fragrance. Aerosols and strong fragrance can trigger symptoms in people with asthma or fragrance sensitivity, and ventilation remains the simplest approach.
Use them with care. Cats and dogs are more sensitive to airborne fragrance and to certain essential oils than people are, and birds are especially sensitive to aerosols. Keep sprays and diffusers out of reach and ventilate the room, since birds and animals with a respiratory condition are commonly noted caution contexts.