The goal of this work is to describe the dynamics of generic homeomorphisms of certain compact metric spaces $X$. Here ``generic'' is used in the topological sense -- a property of homeomorphisms on $X$ is generic if the set of homeomorphisms with the property contains a residual subset (in the sense of Baire category) of the space of all homeomorphisms on $X$. The spaces $X$ we consider are those with enough local homogeneity to allow certain localized perturbations of homeomorphisms; for example, any compact manifold is such a space. We show that the dynamics of a generic homeomorphism is quite complicated, with a number of distinct dynamical behaviors coexisting (some resemble subshifts of finite type, others, which we call `generalized adding machines', appear strictly periodic when viewed to any finite precision, but are not actually periodic). Such a homeomorphism has infinitely many, intricately nested attractors and repellors, and uncountably many distinct dynamically-connected components of the chain recurrent set. We single out several types of these ``chain components'', and show that each type occurs densely (in an appropriate sense) in the chain recurrent set. We also identify one type that occurs generically in the chain recurrent set. We also show that, at least for $X$ a manifold, the chain recurrent set of a generic homeomorphism is a Cantor set, so its complement is open and dense. Somewhat surprisingly, there is a residual subset of $X$ consisting of points whose limit sets are chain components of a type other than the type of chain components that are residual in the space of all chain components. In fact, for each generic homeomorphism on $X$ there is a residual subset of points of $X$ satisfying a stability condition stronger than Lyapunov stability.