Niche and metabolic principles explain patterns of diversity and