Imagine some water freezing. This will often start from a nucleation point and spread out rapidly. If this hits another volume of water nearby that's doing the same thing, you might get a crack in the ice where they hit each other. This is kind of what cosmic strings are. As the universe is cooling and quantum fields undergo phase changes, various regions will spread out and the point where they collide can form a cosmic string. (This is all very theoretical and my explanation is rather vague and handwavy).