How installing app from app market creates collections for the app in content manager.

I am beginner to wix trying to create a third party app which gets installed through app market. While reading this article I found that required collections for the app get created after installing app.

But didn’t find how they are created exactly in code.I saw codebase of booking app but still not able to figure out how collections are created after app installation

Can someone explain it with example code