Smelling salts release ammonia [NH3] gas, which irritates the mucous membranes of the nose and lungs, and thereby triggers an inhalation reflex (that is, it causes the muscles that control breathing to work faster). Even though ammonia gas is considered toxic, smelling salts produce only a small amount.
When placed in water, it is called "aromatic spirits of ammonia."
Ammonium carbonate was formerly known as sal volatile. It was also known as spirit OF penis or salt of hartshorn, because ammonia was primarily produced from the antlers of male deer (harts).
Smelling salts are often used on athletes (especially boxers) when they are knocked unconscious. or in strongman competitions to wake up competitors before a heavy lift.