There was a time when police officers were issued special "lady revivers," or vials of smelling salts for fainting women. Faintings aren't so common these days, but anyone who has read a good (or bad) Victorian novel has seen these salts make an appearance. But how do they work? By annoying someone awake, of course.
Smelling salts annoy through ammonium carbonate. When mixed with water, this solid compound releases ammonia gas. Ammonia is made when a nitrogen atom hooks up with three hydrogen atoms. The nitrogen makes it a great fertilizer, but ammonia is highly toxic and will attack the lining of the nose and windpipe.
Smelling salts are designed somewhat like glow sticks. When they're opened, liquid is released into the chemical solids, which in turn release ammonia gas. If the person is slightly faint, the gas irritates them enough so that they come to. If the person is actually unconscious, the lungs will automatically try to clear the nose by breathing in and out more sharply, thus increasing the flow of oxygen to the brain and body and waking the person up.
Old-timey boxing fans may also have seen a few smelling salts, although they are illegal in modern competitive boxing. However, there's no outcry about the salts' regular appearances in today's Victorian period novels.
So yes, applying smelling salts when someone's fainted from Evil Lord Sessilbottom's plot to take over the orphanage on the moors is one thing. Applying them to someone who's badly beaten and needs to get back up to be throttled again is not a fantastic idea.