Even without the guidance of organized religion, some animals instinctively know that it's a good thing to help others.
For example, when a bird spots a predator, instead of just flying away, it calls out in alarm and warns everyone in the vicinity.
When a dolphin is injured, other dolphins help it swim up to the surface and get some air.
And in a lab experiment that was set up so that one rat had to sit on a platform or else his rat friends would get an electrical shock when they tried to feed, the rats quickly learned to cooperate and take turns sitting on the platform.
You might think that evolution would work against this kind of altruism since, instead of concentrating on their own survival, animals spend time and energy helping others.