As first discussed by Onsager and Feynman, if the temperature in a superfluid or a superconductor is raised, the vortex loops undergo a second-order phase transition. This happens when the configurational entropy overcomes the Boltzmann factor, which suppresses the thermal or heat generation of vortex lines. The lines form a condensate. Since the centre of the lines, the vortex cores, are normal liquid or normal conductors, respectively, the condensation transforms the superfluid or superconductor into the normal state. The ensembles of vortex lines and their phase transitions can be described efficiently by a gauge theory.