Why do some animals only eat vegetarian food and some other animals eat only non-vegetarian or meat products?

In terms of eating habits, Animals can be divided into:
Herbivores: Grass and vegetarian eating animals like Deer, Cow, Goat
Carnivores : meat eating animals like Lions, Tigers, Leopards
Omnivores: which eat both vegetarian and meat like Bears, Crows
An animal is either because over millions of years, they have developed adaptations which allow them to live and thrive by eating a particular type of food.
A simple adaptation is the teeth. Carnivores have sharp and long canines which are very good for catching their prey without letting them escape and also helps to tear away the flesh. Herbivores on the other hand have flat teeth with a large surface area so that they can grind on the grass and soften the grass to pass it down their digestive tract more easily.