Short answer:
App Extensions are an iOS feature that allows developers to extend the functionality and content of their app beyond the app itself, making it available to users in other apps or in the main operating system. And iOS is a standalone app.
For the long answer, you can follow this link https://kingnight.github.io/programming/2021/06/09/Using-Swift-API-availability-to-solve-App-Extension-Compiled-Error.html to read more about it.