Dogs were domesticated when ancient humans formed friendly partnerships with certain wolves. Over time, people selected and bred those wolves for helpful traits like friendliness and obedience, gradually turning them into the loyal and varied dog companions we have today.