Apple added an option in late 2016 to give you the equivalent of cloud-based bottomless Desktop and Documents folders in macOS to pair with iCloud Music Library and what’s now called iCloud Photos. In the iCloud preference pane, you can click iCloud Drive and then check the Desktop & Document Folders box to enable a sort of provisional sync.
If your Mac starts to run out of local storage, macOS will delete files from local storage based on the oldest files with the least use, ensuring that a copy exists in iCloud Drive. If you need the file back, you can just click it and it’s automatically restored. You can also find all the contents of Desktop and Documents folders via iCloud Drive from any Mac on which you’ve enabled the feature.