In system preferences > iCloud let the box of iCloud Drive be checked , click on option button keep the box of desktops and documents be checked .
It depends what storage you are using if it is free 5 GB storage or you have purchased from apple , not only documents and desktops or files store the space other applications like massive photos , notes , mails , calendars old backups also occupy the space .
As soon as the iCloud storage space exceeds the designated space an error will always show , you have to delete the data , use optimise feature see these articles https://support.apple.com/en-in/HT204247
https://support.apple.com/en-gb/guide/system-information/sysp4ee93ca4/mac
https://support.apple.com/en-in/HT201318 - this article is used according to the situations , when data is exceeding and you plan that more storage is to be added , purchase the icloud storage .