The air space in soil contains oxygen to provide for respiration of plant roots and soil organisms. This air space could also contain carbon dioxide as a product of respiration of plant roots and soil organisms. Gas molecules in soil are in continuous thermal motion according to the kinetic theory of gases, there is also collision between molecules - a random walk. In soil, a concentration gradient causes net movement of molecules from high concentration to low concentration, this gives the movement of gas by diffusion. Numerically it is explained by Fick's law of diffusion.