When I was growing up in Wales, the sheepdogs were considered part of the family, usually home-bred, named and absolutely provided emotional support. This was most obvious when an old farmer retired to a nursing home and he would almost always take his dog with him. It was a common sight near nursing homes to see old men shuffling along with a grossly fat retired sheepdog by his side, because they kept being fed what they were always fed (bread and milk and scraps as a rule) but now the only job they did was to shuffle around behind their master instead of running around the mountain all day looking after the sheep. Their primary purpose was to work sheep, but the secondary purpose of being a loyal companion and friend was there too. My own Welsh sheepdog is fed very little and runs around an incredible amount for a non-working dog but he still has the genes to survive on very little and is still inclined to run to fat.
As for cows, most of the milking cows in the local farms had names and were bred on the farm. Most of the tail female lines had been bred on the same farm by the same family for generations. They were part of the family. Hand milking of commercial milkers was on the way out even when I was a child, but those farmers had an amazing bond with the animals that they milked twice a day.
Sheep mostly were not named, but many of the old farmers assured me that whilst during most of the year they were 'just sheep', during lambing season they would re-bond with the individual ewes.
Farm cats tended to be more independent and were mostly left to fend for themselves.
And of course there's the old legend of
Llyn y Fan Fach where the lady of the lake returns to her watery kingdom and calls all her farm animals after her by name. Because the bond with the animals is forever whilst a marriage only lasts as long as the original conditions are honoured...