Even optimistic climate scenarios predict catastrophic consequences for coral reef ecosystems by 2100. Understanding how reef connectivity, biodiversity and resilience are shaped by climate variability would improve chances to establish sustainable management practices. In this regard, ecoregionalization and connectivity are pivotal to designating effective marine protected areas. Here, machine learning algorithms and physical intuition are applied to sea surface temperature anomaly data over a twenty-four-year period to extract ecoregions and assess connectivity and bleaching recovery potential in the Coral Triangle and surrounding oceans. Furthermore, the impacts of the El Niño Southern Oscillation (ENSO) on biodiversity and resilience are quantified. We find that resilience is higher for reefs north of the Equator and that the extraordinary biodiversity of the Coral Triangle is dynamic in time and space, and benefits from ENSO. The large-scale exchange of genetic material is enhanced between the Indian Ocean and the Coral Triangle during La Niña years, and between the Coral Triangle and the central Pacific in neutral conditions. Through machine learning the outstanding biodiversity of the Coral Triangle, its evolution and the increase of species richness are contextualized through geological times, while offering new hope for monitoring its future.