This paper studies homogenization of stochastic differential systems. The standard example of this phenomenon is the small mass limit of Hamiltonian systems. We consider this case first from the heuristic point of view, stressing the role of detailed balance and presenting the heuristics based on a multiscale expansion. This is used to propose a physical interpretation of recent results by the authors, as well as to motivate a new theorem proven here. Its main content is a sufficient condition, expressed in terms of solvability of an associated partial differential equation (the cell problem), under which the homogenization limit of an SDE is calculated explicitly. The general theorem is applied to a class of systems, satisfying a generalized detailed balance condition with a position-dependent temperature.