Nextcloud app integration workflow

I don’t have the skills to understand the whole thing so I’d like to ask.

How does the integration of apps in the Nextcloud work? The Nextcloud provides a backend and provides a basic framework (navbar, login mask, . . . ).

I assume that the Nextcloud provides a REST API and an index. html file as a basic framework.

If you develop an app yourself, you put it in the Apps folder. The integration and registration then takes place automatically.

The app itself can again be an independent backend with a frontend, which is then integrated into the Nextcloud.

Can someone tell me how this all works? Does the Nextcloud read the Apps folder and read all index. html files? This would allow it to deliver the frontend, but not the backend. How then does the backend of the respective app run? And if the Nextcloud already delivers the HTML framework for the interface, how does it render the respective app if required? Does the server place the app in an IFrame container within the HTML code of the basic framework?

If something should be unclear or I should have forgotten something, please contact me. I’ll broaden my question then.

The following posting about the developer API might be of interest for you: