Ionization state of inter-stellar medium in galaxies: evolution, SFR-M * -Z dependence, and ionizing photon escape