I was also surprised to find that file associations on Windows are usually handled by the installer registering them in a global location.

On macOS, your app contains a file that declares its file extensions, and the OS caches that info as needed, making it easy to repair.