Hidden sectors and their implications for particle physics and cosmology