One contribution of 18 to a theme issue 'Human influences on evolution, and the ecological and societal consequences'. Invasive and endangered species reflect opposite ends of a spectrum of ecological success, yet they experience many similar eco-evolutionary challenges including demographic bottlenecks, hybridization and novel environments. Despite these similarities, important differences exist. Demographic bottlenecks are more transient in invasive species, which (i) maintains ecologically relevant genetic variation, (ii) reduces mutation load, and (iii) increases the efficiency of natural selection relative to genetic drift. Endangered species are less likely to benefit from admixture, which offsets mutation load but also reduces fitness when populations are locally adapted. Invading species generally experience more benign environments with fewer natural enemies, which increases fitness directly and also indirectly by masking inbreeding depression. Adaptive phenotypic plasticity can maintain fitness in novel environments but is more likely to evolve in invasive species encountering variable habitats and to be compromised by demographic factors in endangered species. Placed in an eco-evolutionary context, these differences affect the breadth of the ecological niche, which arises as an emergent property of antagonistic selection and genetic constraints. Comparative studies of invasions and extinctions that apply an eco-evolutionary perspective could provide new insights into the environmental and genetic basis of ecological success in novel environments and improve efforts to preserve global biodiversity.This article is part of the themed issue 'Human influences on evolution, and the ecological and societal consequences'.