Original golf balls were made of wood, and it wasn’t until the nineteenth century that they evolved through a number of changes.
They went from wet feathers stuffed into wet leather for shrinking to “gut-ties,” balls made from a Malaysian form of rubber.
At this point someone noticed that the new ball flew further when scuffed up after being hit a few times, and so dimples were added to encourage distance by imitating a well-used ball.
A golf ball with dimples flies further because it has less aerodynamic drag than a golf ball with no dimples.
The effect is pretty dramatic in fact, and a golf ball with dimples flies up to 4 times further than one without.