Bleach works by releasing oxygen molecules in a process called oxidation. The oxygen molecules released by bleach break up the chemical bonds of chromophores.
Natural stains (as well as dyes) produced by everything from mildew to grass come from chemical compounds called chromophores. Chromophores can absorb light at specific wavelengths and therefore cause colors. When chlorine reacts with water, it produces hydrochloric acid and atomic oxygen.