The idea is that the string of lights has a male end and a female end. That way you can have several daisy chained and just plug the one with the male end into the outlet. But if you plan it wrong then you may end up with the wrong end in the wrong place, in which case yeah, use an extension cord or hang the lights all over again.
Oh and it's actually relatively safe this way... Each string of lights normally has a fuse in it, so it prevents the cords from carrying more current than they are designed for.