Domestication is not only of ancient times. It is still happening today! It often involves species that are used for human consumption or for companion, and that become rare in their natural habitat. To prevent extinction, people try to breed them in captivity. In return benefits are easy access to the animals, and the possibility to optimise the animals through selective breeding to the (expected) demands of the market. And 'market' is a very wide concept: demand for food of animal origin, but also demands of farmers for, for example, dairy cows that can be milked by a robot, demand for dogs that can perform certain tasks, demand for horses with certain temperament, etc. There are some (rare) occasions where new tasks are invented for certain animal species, potentially followed by domestication. A recent example may be that of the use of 'sniffer wasps' for explosives detection. These wasps are trained to smell different types of explosives and, subsequently, used in places where it is too dangerous for people (or dogs) to go to. Because wasps are small and can fly they can go places where robots can't go. Possibly these wasps in the future will be different from wild wasps. This is due to directional selection on, for example, trainability.
Prerequisites for domestication
Domestication is not always successful. Despite many attempts, the zebra, for example, has not been domesticated. Even though it is closely related to the horse and the donkey and you can keep it in an enclosed area where it will survive and reproduce, apart from the exceptional case, it has not been successfully tamed. Several generations in captivity and some selective breeding did not make the zebra genetically tame so that it can be ridden. Why is that? People are not sure, but there is a list of prerequisites for successful domestication that seem to hold. The zebra may not meet one or more of them. The apparent prerequisites are:
The animals should be able to adapt to the type of feed they are offered by humans. This may be different (in diversity) from what they were used to in the wild.
Animal must be able to survive and reproduce in the relatively closed quarters of captivity. Animals that need a very large territory are not suitable to be domesticated.
Animals need to be naturally calm. Very skittish or flighty animals will be hard to prevent escaping.
Animals need to be willing to recognise humans as their superior, which means they must have a flexible social hierarchy.
Animal species that do not meet all the above criteria will be very difficult to domesticate. But a fair number of animal species have been domesticated, and the number is still increasing. The early domestication probably was mainly driven by natural selection: the animals that managed best were most successful in producing the next generation. Real selective breeding is of fairly recent origin.