We present a systematic study for ionization state of inter-stellar medium in galaxies at z = 0– with ~140 000 Sloan Digital Sky Survey (SDSS) galaxies and 108 intermediate- to high-redshift galaxies from the literature, using an ionization parameter sensitive line ratio of [O iii ]5007/[O ii ]3727 and photoionization models. We confirm that z ~ 2–3 galaxies show an [O iii ]/[O ii ] ratio significantly higher than a typical star-forming galaxy of SDSS by a factor of 10, and the photoionization models reveal that these high- z galaxies have an ionization parameter of log ( q ion /cm s –1 ) ~ 7.6–9.0, a factor of ~4–10 higher than local galaxies. For galaxies at any redshift, we identify a correlation between the [O iii ]/[O ii ] ratio and galaxy global properties of star formation rate (SFR), stellar mass ( M * ), and metallicity ( Z ). We extend the fundamental metallicity relation (FMR) and develop the fundamental ionization relation (FIR), a four-dimensional relation of ionization parameter, SFR, M * , and Z . The intermediate- and high- z galaxies up to z ~= 3 follow the FIR defined with the local galaxies, in contrast with the FMR whose possible evolution from z ~ 2 to 3 is reported. We find that the FMR evolution of z ~ 2–3 appears, if one omits ionization parameter differences, and that the FMR evolution does not exist for an average metallicity solution of z ~ 3 galaxies with a high-ionization parameter. Interestingly, all of two local Lyman-continuum emitting galaxies (LyC leakers) have a high [O iii ]/[O ii ] ratio, indicating a positive correlation between [O iii ]/[O ii ] and ionizing photon escape fraction ( f esc ), which is successfully explained by our photoionization models. Because [O iii ]/[O ii ] ratios of z ~ 2–3 galaxies, especially Lyα emitters (LAEs), are comparable to, or higher than, those of the local LyC leakers, these high- z galaxies are candidates of Lyman-continuum emitting objects. A strong Lyα emission can coexist with a large f esc of 0.8, and the increasing fraction of LAEs towards high- z reconciles the picture of cosmic reionization whose major ionizing sources are faint galaxies having intrinsically bright Lyα emission.