Where does the oxygen come from in the deployable breathing masks?
The oxygen is provided through Chemical Oxygen Generators. Oxygen masks are triggered either automatically given certain conditions or by the flight crew.

Oxygen generators are usually installed in above each seat row. If the cabin altitude reaches a predetermined height (14,000' is standard) or if the system is activated by the flight crew, overhead panels open and oxygen masks drop out. To put the mask on, it is necessary for the intending user to pull it down and this action releases the firing pin and activates the generator.
The oxidizer core of an oxygen generator usually consists mainly of Sodium Chlorate (NaClO3) mixed with &lt;5% Barium Peroxide (BaO2) and &lt;1% Potassium Perchlorate (KClO4). This core is activated by the application of heat generated usually generated by a mixture of lead styphnate and tetracene which itself is activated by a small explosive charge in a percussion cap are a mixture. This explosive charge is set off by the release of a spring-loaded initiation mechanism which is restrained until released by a pull on the lanyard which is visible when oxygen masks are released from overhead panels. Once activated, the chemical reaction and production of oxygen will continue until the generator has been exhausted which is typically in the range 12 to 20 minutes.