Large scale O2 generation involves cooling air to liquify it, then pulling off the components: Oxygen, Nitrogen, CO2, Argon, etc.
You CAN get Oxygen by electrolysis of water (plus Hydrogen), but the energy expenditure is horrendous.
Certainly O2 generators can be powered by chemical means; the Oxygen masks on airliners rely on chemical release of O2 by the burning of chlorates or perchlorates.
All that said, you can get O2 generators for small applications (bedside, veterinary, etc.) use, up to, and including, institutional generation, say, for hospitals.
To answer your question directly: Bottled O2 is far cheaper than the alternatives.