oh flip.
Well the salts release a chemical–ammonia (I THINK??? its one of those A ones….lemme double check) which irritates the membranes in your nostrils (where the exposed bit of your brain is) and in your lungs which launches you into alertness. It causes the involuntary inhalation reflex.
It doesnt last forever like it does in the movies though. After a person is awakened they have about ehhhhh 15 mins or so before they start feeling sluggish and low on energy again. Especially if injured. More than likely that person will pass out again in the near future.
I've heard from some of my EMT friends that it is literally the most uncomfortable feeling and not fun.