A zipper track is made up of dozens of teeth, each of which combines a hook and a hollow. The idea is to latch every hook on each of the two tracks into a hollow on the opposite track. The latching mechanism, called the slide, is just a collection of wedges. You can see how this system works in the diagram below.
This content is not compatible on this device.
As the slide moves up the zipper, the two teeth strips must enter at a specific angle. As the strips move through the slide, the slide's inclined edges push the teeth toward each other. The strips are offset from each other, so each hollow settles onto a hook in sequence. For this to work properly, each tooth must be exactly the same size and shape, and they all must be perfectly positioned on the track. This would be all but impossible without modern manufacturing technology.
In a well-made zipper, the interlocking teeth form an incredibly secure bond -- it is very difficult to separate the teeth by pulling the two strips apart. But the slide can easily separate the teeth, using a simple plow-shaped wedge. When the slide is pulled down, the wedge pushes against the slanted edges of the hooks, pivoting each tooth off of the tooth below it. Just like that, the zipper tracks are detached.
For more information on zippers, including the story of their invention, check out the links in the next section.