If iCloud Drive is set up in iPad and Mac , for iPad https://support.apple.com/en-us/HT204025
On your iPhone, iPad, and iPod touch
- Go to Settings > [your name].
- Tap iCloud.
- Turn on iCloud Drive.
You can find your iCloud Drive files in the Files app.
If you're using iOS 10 or iOS 9, tap Settings > iCloud > iCloud Drive. Turn on iCloud Drive, and tap Show on Home Screen. Then you'll find your files in the iCloud Drive app.
If you sign out Mac and don't click on keep a copy the files will not be saved on Mac but they are still saved on iCloud.com if iCloud Drive and desktops and documents box is turned as on see the article https://support.apple.com/en-in/guide/mac-help/mchle5a61431/10.14/mac/10.14
With iCloud Drive, you can safely store all kinds of documents in iCloud, and access them from all your computers and iOS devices. If you like, you can have all the files in your desktop and documents folders stored automatically in iCloud Drive. That way, you can save files right where you usually keep them, and they become available on all your computers and iOS devices.
You can use iCloud Drive on Mac computers (OS X 10.10 or later), iOS devices (iOS 8 or later) and Windows computers with iCloud for Windows (Windows 7 or later required). You must be signed in to iCloud using the same Apple ID on all your computers and devices.
The files will stay on iPad as you didn't signed out Apple ID from it , it doesn't matter you sign out Mac ( even you forgot to click on keep a copy ) , the data is saved on iCloud server / synced from iPad with the help of iCloud drive turned in it and saved the data in the Files app.