A good example is to think about when you're in rush hour traffic -- there are times when you'll speed up to 20 mph, then slow to near zero, as traffic ahead of you changes lanes, exits, etc.
Wind works the same way. If the Earth were flat, there would be few wind gusts. But with the terrain, you get bumps in the road that slow down and speed up wind as it interacts with terrain.
The sun also helps cause wind gusts, as it warms the surface unevenly, you get some pockets of hot, rising air, with air then rushing in to replace it.