In short, they had to follow the food. Like most large animals, humans had to be migratory because they had to follow food sources around. Once they had exhausted local food sources, or if the herd they were tracking had moved on, they had little choice but to follow them.
Agriculture gave humans the ability to domesticate and grow their food, which enabled people to stay in one place.