This took long enough:
Roughly 80% of the air you breathe in is nitrogen. Additionally, nitrogen is effectively inert… what you breathe in, you breathe out. Consequently, unlike carbon dioxide which is a biologically produced waste product, your lungs essentially ignore nitrogen. If the partial pressure of nitrogen goes up or down, your lungs don’t really care.
So if the nitrogen percentage goes up to 100%… your body doesn’t react. Unlike a small increase on CO2, your physiology doesn’t freak out. There no discomfort or pain with increased nitrogen. The only real effect if that it displaces the oxygen in your blood, and then in your brain. And the result of that is that within a few seconds, you simply pass out, and peacefully to most accounts. And within a few minutes, you are brain dead.
Breathing in nitrogen (or helium, freon, a few other gasses) is just about the most peaceful way to go. As a bonus, nitrogen is cheap, plentiful and easily produced. Unlike the chemicals used for lethal injection executions, nitrogen can be had from many, many sources. Unlike lethal injection chemicals, there’s no way to screw up nitrogen… just strap a mask over the face and turn it on. There is no such thing as a mammal that could possibly survive more than a few minutes on pure nitrogen, so there’s no chance of botched executions.
So why has it taken this long for it to be made available as a means of execution?