Evolution of diversity and extinction resistance
The topic you describe is very interesting and known as "species selection." Some traits exist that not only affect the reproductive success of individuals, but also affect the diversification rate of the entire species, either through affecting the extinction rate, the speciation rate, or both. 

To give you an example, I'll summarize this paper by Goldberg et al 2010. Self-incompatibility (SI) in plants is the ability of a plant to reject its own pollen to prevent inbreeding. This mechanism is expected to increase the genetic diversity of the plant's offspring. Self-incompatibility has been lost many times in the history of flowering plants, yielding self-compatibility (SC), which allows a plant to breed with itself. A plant that can breed with itself has an advantage in that even if the population size is low and it can't 'find' another individual to breed with, it can still breed with itself to produce offspring. However, this trait is expected to result in decreased genetic diversity in the offspring due to inbreeding.

The transition from SI to SC is a common transition that cannot easily be reversed. One might expect, then, that SI would be very uncommon as lineages would lose it to SC. However, it turns out that SC lineages have a lower diversification rate than SI plants in the Solanaceae due to the fact that SC lineages have a higher extinction rate than speciation rate. This difference in diversification allows SI to persist. This is an example of trait-dependent net diversification rate. It is not known exactly why SI lineages have a higher net diversification rate, but it could be related to the higher effective population size which results in "increased polymorphism,
lower linkage disequilibrium, more
efficient response to purifying selection, more
extensive geographic distribution of genetic diversity,
and lower rates of extinction".

If you want to read more, I can suggest a few more papers:

The Units of Selection by R.C. Lewontin

Darwainism and the Expansion of Evolutionary Theory by S.J. Gould

Species Selection: Theory and Data by D. Jablonski