It's a matter of resources, and how to obtain them. There is a lot of plant matter, which is relatively easy to renew; if an animal is adapted to grazing, the resources are plentiful, and once they get past a certain size, there is basically no carnivore that will prey on them (though their babies may be fair game for predators).
For carnivores, it's a different story: being too large would be detrimental to agility and it may make it impossible to catch prey. There is also less to eat, according to the biological food pyramid, as carnivores are secondary or tertiary consumers. Herbivores are primary consumers.
Tank build is a high risk high reward build, you start grind the resource with the fastest spawnrate, plants. If you somehow manage to go big in size there are not many low tier predators can farm you anymore due to build's sheer size. Giraffes... man they're just one gag build to deal with server spesific problems like lack of ground plants, idk how they do manage it but it has to do something with agility stat they got. What i'm saying is a tank build is more viable with a stable supply of resources unlike carnivore faction's eternal struggle to do raids.
Wait a second why do i talk like this, this ain't r/outside !
Hard for a massive fat thing to chase shit. Easy for a massive fat thing to fend off shit which wants to eat it.
Plant leaves, not counting the ones we've altered via selective breeding are generally poor quality food. Plants have cell walls that make it difficult to extract the nutrients from it. Unlike animal cells which are surrounded by a membrane.
So to compensate, herbivores have to either eat a lot and race it through the gut just getting the easy nutrients. Like an elephant, whose poop is barely digested. Or they can eat a little and save their energy with a very slow metabolism like a sloth.
Or they can follow strategies like cows, keep it in the gut for a long period of time, let the enzymes, acids and stomach bacteria work on the plants, then digest the bacteria and extracted nutrients.
The sloth strategy doesn't seem to be the preferred route, so eat a lot means they need a big gut to store all the food, which also means a big body to support that gut.
Eating plants is a slow way to get calories. But metabolism scales up slower than size. You get bulk efficiency in large animals. An animals heart has to beat slower per pound in large animals. And they consume fewer calories per pound as they get bigger. Economies of scale basically.
Not all herbivorous mammals are big. Goats, sheep, koala, rabbits and hares, pikas, and rodents such as capybara, chinchilla, beaver, mice and guinea pigs. Plus mid sized animals like deer and gazelle.
I'm not sure if 'most' herbivore mammals are big. Also: whales are not herbivores.