In the standard cosmological model a mysterious cold dark matter (CDM) component dominates the formation of structures. Numerical studies of the formation of CDM halos have produced several robust results that allow unique tests of the hierarchical clustering paradigm. Universal properties of halos, including their mass profiles and substructure properties are roughly consistent with observational data from the scales of dwarf galaxies to galaxy clusters. Resolving the fine grained structure of halos has enabled us to make predictions for ongoing and planned direct and indirect dark matter detection experiments. While simulations of pure CDM halos are now very accurate and in good agreement (recently claimed discrepancies are addressed in detail in this review), we are still unable to make robust, quantitative predictions about galaxy formation and about how the dark matter distribution changes in the process. Whilst discrepancies between observations and simulations have been the subject of much debate in the literature, galaxy formation and evolution needs to be understood in more detail in order to fully test the CDM paradigm. Whatever the true nature of the dark matter particle is, its clustering properties must not be too different from a cold neutralino like particle to maintain all the successes of the model in matching large scale structure data and the global properties of halos which are mostly in good agreement with observations.