While the presence of morphologically cryptic species is increasingly recognized, we still lack a useful understanding of what causes and maintains co‐occurring cryptic species and its consequences for the ecology, evolution, and conservation of communities. We sampled 724 Pocillopora corals from five habitat zones (the fringing reef, back reef, and fore reef at 5, 10, and 20 m) at four sites around the island of Moorea, French Polynesia. Using validated genetic markers, we identified six sympatric species of Pocillopora, most of which cannot be reliably identified based on morphology: P. meandrina (42.9%), P. tuahiniensis (25.1%), P. verrucosa (12.2%), P. acuta (10.4%), P. grandis (7.73%), and P. cf. effusa (2.76%). For 423 colonies (58% of the genetically identified hosts), we also used psbAncr or ITS2 markers to identify symbiont species (Symbiodiniaceae). The relative abundance of Pocillopora species differed across habitats within the reef. Sister taxa P. verrucosa and P. tuahiniensis had similar niche breadths and hosted the same specialist symbiont species (mostly Cladocopium pacificum) but the former was more common in the back reef and the latter more common deeper on the fore reef. In contrast, sister taxa P. meandrina and P. grandis had the highest niche breadths and overlaps and tended to host the same specialist symbiont species (mostly C. latusorum). Pocillopora acuta had the narrowest niche breadth and hosted the generalist, and more thermally tolerant, Durusdinium gynnii. Overall, there was a positive correlation between reef habitat niche breadth and symbiont niche breadth—Pocillopora species with a broader habitat niche also had a broader symbiont niche. Our results show how fine‐scale variation within reefs plays an important role in the generation and coexistence of cryptic species. The results also have important implications for how niche differences affect community resilience, and for the success of coral restoration practices, in ways not previously appreciated.