I figured it out.
There isn't a way to directly copy files to the root directory of the Files app, but there is a workaround.
If you are copying multiple files and/or folders, it may be easier to zip them first.
PC to iPad
1. On the iPad, download Brave, Chrome or Firefox (web browsers) from the Apple App Store. You only need one of them. (My favourite is Brave since it has built-in ad blocking, but that is off topic for this question.)
2. Connect the iPad to the Windows computer with iTunes using a USB cable and trust the computer when prompted.
3. In iTunes, select the device in the top bar. Then, in the left column, click on "File Sharing" (it may also be called "Apps" in older iTunes versions).
4. Under "File Sharing", you will see a list of apps. Select one of the aforementioned web browsers, and under "[appName] Documents" in the right column, drag files you want to copy there or click the "Add..." button (may also be called "Add File...") to browse for files to add manually.
5. On the iPad, open the Files app, then go to "On My iPad" under "Locations" in the left column. You will see folders with app icons on them. Open the folder with the name of the browser app and the icon of the browser app you chose earlier. (The app folder will not be visible if an app has no files. Do not empty out the folder, otherwise you won't be able to see it.)
6. You will see your copied files in the folder. Now, you can move them anywhere you like in the Files app by dragging them around, including the root directory of "On My iPad".
iPad to PC
1. Follow steps 1-3 above.
2. Open the Files app on the iPad, go to "On My iPad", then open the app folder of the browser app you installed as described above. If you do not see the app folder of the browser app you downloaded, that means the app folder is empty. To solve this problem, create a dummy text file `donotdelete.txt` with whatever text you want inside, follow the steps above to copy the text file to your desired browser app, and do not delete it.
3. In the Files app, drag the files you want to copy to your PC to the app folder of the browser app you installed.
4. Under "File Sharing" in iTunes, select the browser app where you copied the files, then simply drag them out of iTunes into your desired folder. You can also select them and click on the "Save..." button (also called "Save To..." in older versions).
You can also use LocalSend, a free app, to transfer the files over the local network without uploading them to cloud storage.