Where are dogs from?
Dogs are a kind of wolf. They were the first animals that people fed on purpose, earlier than sheep or cows or chickens. People have been taking care of dogs since about 13,000 BC, in the Stone Age, before the beginning of farming (and possibly much earlier; maybe as long as 100,000 years ago, before people left Africa). Most likely, dogs themselves began this relationship by hanging around people's campsites (there weren't any villages yet), trying to snatch some of their garbage to eat. At first, people must have tried to scare the dogs away. But after a while, some of them realized that the dogs ate rats, and also helped to clean up food garbage that drew flies and other insects. So campsites with dogs were cleaner and healthier than campsites without dogs. Fewer people got dysentery and died.
The people who lived in these cleaner campsites grew up stronger than people who shooed away dogs, and there were more of them. Eventually, the dog-lovers pretty much took over, all over the world. And dogs evolved to be able to digest more and more people-garbage, especially grains.
Somewhere around this time, people probably began to see that the dogs could do other things too. Dogs would bark and let you know if any big animals or human enemies were coming. Dogs could let you know if the baby was getting into trouble. So people began to encourage the dogs to hang around. At some point, people also began to teach dogs to obey them, and they also started to use the dogs to help them hunt other animals, and to pull sleds. Dogs were the earliest domestication of any animal, and may have given people the idea of domesticating sheep and goats, which came next. Nobody's sure whether this domestication of dogs happened only once, in one place, or many times, all over Europe and Asia.
Dogs continued to be useful to people, and to live with people, even when people started to farm and to live in villages. It turned out that dogs could also guard sheep, and help to herd the sheep when you were moving them from one pasture to another. Some people ate dogs, especially in China. You might think of those dogs as a great way to turn garbage into food. Even in places where people usually didn't eat dogs, like Europe, dogs provided an emergency source of food when there was a famine. If you were starving, you had to kill and eat the village's dogs before they decided to eat you (and then there would be a lot more rats than usual, without the dogs to eat them, and you would live on the rats for a while).
Today you probably think of your dog as a pet, and give it food. But in antiquity and in the Middle Ages, hardly anyone was rich enough to give food to a dog on purpose. Most dogs had to find their own food in people's garbage, or they had to eat rats. Only working dogs that herded sheep or pulled sleds would have been given food. So most dogs, like most people, were skinny and had lots of diseases and bugs.