I dont know if it works like macOS since I dont use macOS - but it's not a simple copy-to-cloud. It actively replaces file handling in those folders, which breaks a bunch of applications like games that save stuff in Documents/My Games..
The way iCloud Desktop works is that it uploads your stuff to the cloud, using your iCloud Storage quota.
The way that OneDrive works is that it uploads stuff to OneDrive, using your Microsoft 365 storage quota.
The way iCloud Desktop works is that it uploads your stuff to the cloud, using your iCloud Storage quota.
The way that OneDrive works is that it uploads stuff to OneDrive, using your Microsoft 365 storage quota.