Dark matter - from its origins to its freeze-out