I think its a chemical generator that activates then you pull on it and generates oxygen for up to 10 minutes, but that's enough time for the pilots to get the plane down to 10,000 feet or below, which has breathable air.
It absolutely is a chemical generator. Because it's actually pure oxygen, and carrying that onboard a plane in any other form (oxygen bottles etc) at an amount that would keep 300 or so people alive would make the plane even more of an explosion hazard than it already is.