How do animals decide what to eat and what not?
To answer with a question: How do you decide what to eat (if you don't know whether something is edible)? 

All animals have evolved taste and smell (and I'm sure even prior to eyesight). The purpose of taste and smell in terms of nutrition is to determine if something is edible. If something tastes bitter or extremely sour, this is mostly a warning sign for toxins or advanced microbial degradation. The same accounts for smell: If you let raw meat foul, the smell is unbearable. Why? Because our brain is telling us not to eat this.