How the bench install-app work?

In my path to learn more, I want to understand how the install-app works on the sites.
Does it only add link of the app to the site config/db/… ?
Or does it copy any file to the site directory?
Or what happend?

If I have payload on the custom app (e.g images) will it affect the install-app process time?

Thank you