Dogs are faithful and friendly to human beings most likely because of their genes, a new study published in the journal Science Advances says.

A team of scientists from Indiana in the United States found variations in several dog genes that make them friendlier than wolves, from whom they are descended. Genes are also the reason some dogs are friendlier than others, the team discovered.

Dogs evolved from wolves tens of thousands of years ago, and over this period, certain genes that make them friendly to humans were selected for the study. “Our finding of genetic variation in both dogs and wolves provides a possible insight into animal personality, and may even suggest similar genes may have roles in other domestic species,” Dr Bridgett vonHoldt of Princeton University told the BBC.

The researchers studied the behaviour of 18 domesticated dogs and 10 wolves kept in captivity. After a number of tests on sociability and the animals’ abilities to solve problems, the scientists found that dogs are much friendlier and spend more time greeting human strangers and gazing at them.

DNA tests found a link between certain genetic changes and dog behaviour, such as paying attention to strangers. In human beings, such genetic changes are associated with the Williams-Beuren syndrome, which makes people highly sociable.