What you're trying to do is called a semi-join (or an anti-join if you use NOT IN). These are useful for gathering table A if it contains or does not contain some relational object (e.g. find all accounts with a contact named Bob).
SELECT Id,Name FROM Account WHERE Id IN (SELECT AccountId FROM Contact WHERE FirstName = 'Bob')
A sub-query is slightly different. It's a left inner join that grabs all of table A, and any of the table B records (respecting the criteria you give).
SELECT Id,Name,(SELECT Id,Name FROM Contacts WHERE FirstName = 'Bob') FROM Account
This will give me all accounts whether they have a contact named Bob or not. You can read up more on semi and anti-joins in the documentation here:
Specific to your issue though, the object you're working with appears to be somewhat abstract. It appears as though a ContentFolderItem can be either a ContentDocument or a ContentFolder. You'll notice the ContentFolderItem has a flag called IsFolder. You can read more on the object here:
In this case you can just query the ContentFolderItem object as a semi-join to the ContentFolder object:
SELECT Id FROM ContentFolderItem WHERE ParentContentFolderId IN (SELECT Id FROM ContentFolder where ParentContentFolderId = 'abcd...')
This will give you all ContentFolderItems (documents and folders) inside the folder whose parent folder has the Id 'abcd...'. Normally you could just traverse the relationships upward like this:
SELECT Id FROM ContentFolderItem WHERE ParentContentFolder.ParentContentFolderId = 'abcd...'
however... this is a special object that requires filtering on Id. You can't run very broad queries on these tables.