Basically every living creature only has to live as long as necessary to achieve maturity, find a mate, reproduce and optionally care for its offspring for a while. Reproduction has to be repeated as many times as is required to avoid population decline, taking into account the offspring mortality rate which is normally quite high. Any living time after that is just a free bonus and is not maintained by natural selection. It’s just there. So life expectancy of a species depends on how much time is required for this species (on average) to complete doing all the things above.
Latest Answers