When does macOS delete local iCloud Drive files? I want to free disk space.

Apple documentation about this says "When storage space is needed, only the files you recently opened are kept on your Mac".

Ok, so I have this 25GB file in my computer that I'm going move to the Documents folder and I'm wondering if it will really delete if from my computer once it has uploaded because I need more space to copy other projects into my computer.

"When storage space is needed" is pretty abstract to me, I wanted to know how this really works.
“Your Mac keeps all of your recent files on your computer, but keeps your older ones only in iCloud, ready for you to download when you need them again”, Apple says. 

So as long as you still have enough free space on your hard disk the files will stay there.