We develop topological dynamics for the group of automorphisms of a monster model of any given theory. In particular, we find strong relationships between objects from topological dynamics (such as the generalized Bohr compactification introduced by Glasner) and various Galois groups of the theory in question, obtaining essentially new information about them, e.g. we present the closure of the identity in the Lascar Galois group of the theory as the quotient of a compact, Hausdorff group by a dense subgroup. We apply this to describe the complexity of bounded, invariant (not necessarily Borel) equivalence relations, obtaining comprehensive results, subsuming and extending the existing results and answering some open questions from earlier papers. We show that, in a countable theory, any such relation restricted to the set of realizations of a complete type over ∅ is type-definable if and only if it is smooth. Then we show a counterpart of this result for theories in an arbitrary (not necessarily countable) language, obtaining also new information involving relative definability of the relation in question.