The origin and maintenance of coherent magnetic fields in the Universe is reviewed with an emphasis on the possible challenges that arise in their theoretical understanding. We begin with the interesting possibility that magnetic fields originated at some level from the early universe. This could be during inflation, the electroweak, or the quark-hadron phase transitions. These mechanisms can give rise to fields which could be strong, but often with much smaller coherence scales than galactic scales. Their subsequent turbulent decay decreases their strength but increases their coherence. We then turn to astrophysical batteries which can generate seed magnetic fields. Here the coherence scale can be large, but the field strength is generally very small. These seed fields need to be further amplified and maintained by a dynamo to explain observed magnetic fields in galaxies. Basic ideas behind both small and large-scale turbulent dynamos are outlined. The small-scale dynamo may help to understand the first magnetization of young galaxies, while the large-scale dynamo is important for the generation of fields with scales larger than the stirring scale, as observed in nearby disk galaxies. The current theoretical challenges that turbulent dynamos encounter and their possible resolution are discussed.