MinuteEarth explains through amusing animation, exactly why the brains of domestic animals (pets, farm animals) are far smaller than the brains of their wild counterparts. Much of it has to do with the fact that the domestic animals feel safe in their surroundings, which allow them to let down their guard far more easily and reduces the fight or flight response. Additionally, domestic animals no longer have to hunt for food, again reducing the area of the brain necessary to hunt.
When you compare wolves and dogs between individuals of the same size, the wolves have bigger brains no matter what that body size is. What’s more, across different domesticated animals, a disproportionate amount of the shrinkage happened in parts of the brain that monitor information from the outside world and tell animals when and how to freak out sort of like the brain’s panic button.