Sheep and goats were first domesticated 11,000 years ago, while cats became pets around 7000 B.C. with the advent of agriculture. (As people collected and stored grain, it would attract mice, which would then attract cats.) Around the same time, people started keeping cattle for consumption purposes. Several thousand years later, around 4000 B.C., as trade routes developed, humans began using oxen, donkeys, and camels to transport goods. Horses were eventually domesticated for both riding and carrying goods, but scholars differ on which purpose came first.
Thus, development of agriculture and trade routes made humans domesticate animals.