It is based on available storage space on your device. iCloud is a sync system that means it gives you access to your files from any device logged in with the same Apple ID. When you change a file on your Mac, iPhone will show you the changed file (of course after the change syncs). You do not change a copy of a file, you change the file actual file. So files are kept on your computer and stored in the Apple Cloud.
This is different from a system like Dropbox in that Dropbox keeps a copy of a file online. You can have a 64 GB iPhone and 1 TB in Dropbox space, there is no connection between the two.
Taking a side track to better understand iCloud is a good explanation given by The Mac Observer:
iCloud syncs your data between your Apple devices. If you delete a file in iCloud on one device, it will be deleted on all other devices. But that means that if a device is infected with malware and your files get corrupted, they get corrupted on all iCloud-enabled Apple devices.
iCloud Backup is a good start, but it̵7;s not a real backup either. This service backs up many things on your device, however it does not back up data that is already in iCloud. Services like Contacts, Calendars, Safari Bookmarks, Apple Notes and Messaging in iCloud are not included in iCloud Backup. A real backup will back up everything.
So when you ask “At what point will the Mac download stuff to iCloud?”, The answer is that always uploads some stuff to iCloud. You can fine-tune your storage needs to speed up access to files.
When you select “Optimize storage” on your Mac, it will move things like movies and TV shows you’ve already watched from local iTunes storage to iCloud (freeing up some of your disk space). You also have the ability to store other items, such as email attachments, in iCloud.