The ingredient in the spray makes the eyes swell and causes pain and sometimes temporary blindness.
The compound which is used in the pepper spray is Oleoresin capscicum, it is the same compound that make red chilly peppers hot.
Manufacturers combine the concentrated oil with water, glycol and a propellent, such as nitrogen to conform to the legal requirements for using the spray.