Biophilia explains:

Topoisomerases untangle the mess, very carefully, with itty-bitty molecular scissors.