Historical biogeography, ecology and species richness