We present detailed discussions of cooling and trapping mechanisms for an atom in an optical trap inside an optical cavity, as relevant to recent experiments. The interference pattern of cavity QED and trapping fields in space makes the trapping wells distinguishable from one another. This adds considerable flexibility to creating effective trapping and cooling conditions and to detection possibilities. Friction and diffusion coefficients are calculated in and beyond the low excitation limit and full 3-D simulations of the quasiclassical motion of a Cs atom are performed.