It is because different animals have different eating habits.
Animals such as deer, butterflies, cows, giraffes, etc. eat only plants. Such animals are known as herbivores .
Animals such as eagle and lions mostly eat other animals.Such animals are known as carnivores.
Furthermore, there are some animals such as chimpanzees and rats that eat both plants and animals. These animals form another group which is known as omnivores.