If you want to make a teleological argument, then you could equally ask why agricultural animals, compared to wild animals, have much higher fat content and other characteristics that humans find delicious.
All evidence suggests those features are favored by humans, who are the animals currently responsible for ensuring their continued reproduction.
Yes, that’s how agriculture works. You select the ones that are the plumpest and tastiest and breed those. Doesn’t change the origin.
So cows and pigs - like many fruiting plants - co-evolved with the creatures that fed on them. In both cases, those creatures became necessary for their long-term survival.
Angiosperm co-evolution goes back hundreds of millions of years. Animal husbandry goes back what, 10,000? That’s an evolutionary blip. Yes, long enough to select for traits we prefer, but not long enough to develop the kind of symbiosis we see with fruits. Domestic pigs and cows do get some benefits from being kept, but we certainly aren’t necessary, except maybe some sheep.