Physics of nonlinear optics