It's quite straightforward; as DNA is pulled apart the part of the helix ahead of the replication fork is subject to increased tension (i.e. for every twist pulled out at the fork, the DNA ahead of the fork has another twist forced into it). At some point the DNA begin to supercoil and you can't unwind it anymore because the tension is too high. Topoisomerase (also called DNA gyrase, though I'm not sure if/what the difference is) simply relieves this tension by cutting a strand of DNA, unwinding a twist in the DNA, and then ligating it back together. There are videos on youtube if you're interested.