The sandbox at St. Andrews.
Before there was a tee, there was a wooden box of damp sand at the start of every hole.
The original "tee"
For most of golf's 500+ year history, players teed up by scooping damp sand from a wooden box at the start of each hole, piling it into a small cone on the ground, and balancing the ball on top. Caddies carried towels to wash the players' hands afterward. The same hand-washing tradition survives today as the ball-washing station.
St. Andrews introduces the sandbox
By the 1880s, the holes at the Old Course at St. Andrews were getting noticeably deeper from a century of golfers scooping sand directly out of them. To fix the wear, the course began providing dedicated sandboxes at the start of each hole. Some of those original sandboxes still exist at Elie Golf Club (Earlsferry Links), the oldest surviving public sandboxes in the world.
The teeing area
Old Tom Morris, the keeper of the green at St. Andrews from 1864 to 1903, is credited with creating separate, formal teeing areas at the Old Course around 1875. Before that, players teed off within two club-lengths of the previous hole.
The bridge from sand to wood
The sandbox era did not end in one moment. Wooden tees were introduced and adopted slowly through the 1890s and 1900s. The first patented tee (Bloxsom and Douglas, 1889, Scotland) and Grant's 1899 American patent ran in parallel with sand for decades. By 1925 when Lowell's Reddy Tee hit the market through Walter Hagen, the sandbox was sliding into history.
What we take from this
Golfers have always made do with what the course gave them. The sandbox era taught the game one durable lesson: the tee is not optional, and how you tee up matters more than most players realize. We are still figuring out what the next version looks like.
Source
The Scottish Golf History project's "Tee" article documents the sandbox history.