I found the solution. I looked into ui.ContentTree.js that is
responsible for creating the markup of the content tree.A component is
added as a sub-component of a component if the parent has set the
cq:isContainer node to "true".Then all the components that are added
with data-sly-resource are added as childs of the parent component.