The boat starts moving forward. But, because the wind is perpendicular to the boat, even when its moving the wind is still coming in at the same velocity, so it's still producing thrust. If you can get the boat efficient enough, it can harness enough of that wind energy to reach a velocity along the sailboat's line of motion higher than the velocity of the wind relative to the ground.
Note that boats can only do this when sailing at least somewhat offcenter from the wind direction. When sailing directly downwind, the faster the boat goes, the slower the wind is relative to the boat, leeching away thrust.