The dynamics of dark matter provides the backbone of studies of cosmic structure formation. Despite our ignorance about the particle physics nature of the elusive dark matter, its microscopic properties leave a distinct imprint on its macroscopic dynamics which can be studied in computer simulations. Such N-body simulations have driven most of our theoretical knowledge about the distribution of matter in the Universe which in turn reflects properties of the dark matter particle. I will review the theoretical assumptions underlying such simulations and how they are used to study the nature of dark matter through its dynamics. I will particularly focus on recent attempts to model dark matter in the continuum limit. I will demonstrate how such new methods can be used to overcome known problems of N-body simulations, but also help to gain completely new insights into dark matter dynamics. Finally, I will report on recent results on the formation and evolution of the very first haloes that form in the Universe and show that they are in many ways different from later generations of haloes thus providing us with new insights into how the density profiles of haloes are set dynamically.