Ecological processes are central to the formation of new species when barriers to gene flow (reproductive isolation) evolve between populations as a result of ecologically-based divergent selection. Although laboratory and field studies provide evidence that ‘ecological speciation’ can occur, our understanding of the details of the process is incomplete. Here we review ecological speciation by considering its constituent components: an ecological source of divergent selection, a form of reproductive isolation, and a genetic mechanism linking the two. Sources of divergent selection include differences in environment or niche, certain forms of sexual selection, and the ecological interaction of populations. We explore the evidence for the contribution of each to ecological speciation. Forms of reproductive isolation are diverse and we discuss the likelihood that each may be involved in ecological speciation. Divergent selection on genes affecting ecological traits can be transmitted directly (via pleiotropy) or indirectly (via linkage disequilibrium) to genes causing reproductive isolation and we explore the consequences of both. Along with these components, we also discuss the geography and the genetic basis of ecological speciation. Throughout, we provide examples from nature, critically evaluate their quality, and highlight areas where more work is required.