It makes the program run at a consistant rate. It's sort of like wait, but it waits until the number of frames specified since the last vsync, making the game run smoother. In general, you want a vsync in any main game loop.