H2O2 is Peroxide. As it breaks down on the surface of the tooth due to body temperature it changes to H2O (water) and releases the remaining molecules of oxygen. These lonely molecules multiplied by probably millions or billions are so small they penetrate through the substrate of the enamel into the tooth, oxidizing and whitening any dark protein chains located within the tooth structure. This process is gentler to the enamel on your teeth than a can of soda pop.
The enamel does not become more porous, but the porosity is cleaned out due to the action of the peroxide. Any staining from dark foods or drinks are extrinsic (surface) stains only and can be cleaned off with a cleaning from the dental office. Patients can whiten once and sometimes go for years before they whiten again. And the only reason they are whitening again is because the teeth are relapsing back to a darker shade due to age, disease or medications.
Whitening one's teeth is not dangerous and lends itself to increased or better oral hygiene because the patient no longer feels self conscious about the condition or shade of their teeth.