A first-principles approach to the nonlinear flow of dense suspensions is presented which captures shear thinning of colloidal fluids and dynamical yielding of colloidal glasses. The advection of density fluctuations plays a central role, suppressing the caging of particles and speeding up structural relaxation. A mode coupling approach is developed to explore these effects.