What is at the heart of new species formation? It all starts with a single population of a species which for whatever reason (genetic bottlenecks, founder effect, etc.) ends up being split geographically to the point where no interbreeding occurs for a certain length of time.
Given that the two habitats are different, the individuals in each population will adapt differently to counteract different selection pressures. Say for example the ants in the forest experience a warmer and more nutrient-rich surrounding compared to the emigrated ants on a nearby, although disconnected, beach.
The adaptations acquired by both populations over a long time will get increasingly disparate. When these pass a threshold, the two populations can no longer interbreed, even if…