The 1958 Disney documentary "White Wilderness" popularized the idea that lemmings occasionally commit suicide in droves, plunging off seashore cliffs to drown themselves below and mitigate occasional population explosions. Consequently, a generation of children has grown up accustomed to the idea that suicide exists in the animal kingdom. In all likelihood, however, it does not.
Suicide is "the act or an instance of taking one's own life voluntarily and intentionally," according to Merriam-Webster, and most experts don't believe animals are capable of such a deed. However, that's not to say animals do not, on occasion, die in mysterious ways that may appear to mimic suicide. If an aquatic animal extricates itself from its watery environs, for example, that can look an awful lot like suicide to the untrained eye.
But experts tend to attribute such strandings to factors like sickness, injury, old age or loss of navigation. Beached whales might have followed prey too closely to shore, ventured into dangerously shallow waters to avoid predators or accompanied at-risk pod members and found themselves beached as well.
Another noted phenomenon is self-injurious behavior (SIB). The exact causes of SIB are unknown and likely vary from case to case, but potential factors include stress, isolation, fear, disease, malnutrition and boredom. Birds, for example, might pull out some or all of their feathers, sometimes completely denuding themselves before proceeding to peck at their flesh. Primates may bite themselves, and dogs and cats might practice excessive licking.
These actions are thought to produce calming sensations that help the animals cope with their situations, but they can be also be a threat to an animal's health depending on the severity. Usually the first step is to check for an underlying medical condition that could be fueling the behavior. From there, steps should be taken to remedy any additional factors that could be fanning the fire.