The fact that topological defects such as monopoles or strings do not seem to have formed in the early universe can be used to constrain cosmological models, especially in the contexts of grand unified theories and inflationary preheating. It has been commonly assumed that defects are formed in phase transitions by the Kibble mechanism, but this is strictly speaking only true in global theories. I argue that in gauge field theories, which tend to be more relevant for cosmology, the gauge field plays an important role. The scenario I describe leads to several interesting predictions, which can be tested in computer simulations and superconductor experiments. I also discuss its cosmological implications.