In the iPad the iCloud Drive is turned as on so they are accessed https://support.apple.com/guide/ipad/set-up-icloud-drive-ipad847732d1/14.0/ipados/14.0
The Mac must be signed in with same Apple ID and password on the same network and iCloud drive , desktops and documents box must be turned as on so that they sync https://support.apple.com/en-in/guide/mac-help/mchle5a61431/10.14/mac/10.14
If you have unchecked the box of desktops and documents in Mac .
It will prompt the items from this desktop and the documents folder are available in iCloud Drive , to remove items from iCloud Drive , move them to your desktop and documents folder on this Mac , click on show in finder .
Again open system preferences > iCloud > iCloud Drive > the box of desktops and documents box is unchecked , tap with cursor over the box , a circle rotates setting up the box gets checked .
You will notice a folder is created literally on the desktop , tap it a pop up window appears the items on this desktop on this Mac have been moved into a new folder called “ Desktops - Apples Mac book …( the name of Mac will be written in the existing desktop folder in iCloud Drive , you can combine the contents of these folders any time , click on show in finder .
If you right click on the folder created on the Mac and move to trash , restart the Mac and empty the trash , but again the documents are placed in a right place in iCloud Drive as well in iCloud server .