serendipity

noun
1

The phenomenon of making an unplanned, fortunate discovery through a combination of unexpected circumstances and insightful recognition.

2

An unsought, unintended or unexpected, but fortunate, discovery or learning experience that occurs by accident.

3

The occurrence and development of events by chance in a happy or beneficial way.

Definitions come from the Free Dictionary API (dictionaryapi.dev), with Wiktionary as a fallback when it is slow, and are cached for up to 24 hours.