Folder in iCloud that stores files only in cloud but doesn't sync with Mac
It is possible to manage this - basically you have two options:
1) Let macOS handle this automatically
You enable this from System Preferences by clicking Apple ID, iCloud and then ensure that Optimise Mac Storage is checked.
This ensures that everything is stored in iCloud Drive, and as much as possible is also stored on the Mac. However as available space becomes low, the system might delete files from the Mac so that they're only stored in iCloud.
In this case you have no control over which files and folders macOS keeps on the computer and which are only available in iCloud.
2) Handle it manually yourself
In the Finder open iCloud and right-click the folder and select Remove Download. This removes the folder's contents on your Mac, but keeps it in iCloud Drive.