Welcome to MR! We need some more information to help - which version of macOS and iPadOS? Did you run any update before you discovered that ePubs/PDFs are missing? You are using the same Apple ID on both devices? How do you sync your Books library between the devices? How to you install books on the iPad or Mac?
On the iPad:
check wether under Settings>Books »Purchases from other devices« is enabled.
Disable and enable Background App Refresh. Under the Syncing Section,
disable and enable Reading Now and iCloud Drive.
Then go back to Settings and tap on your Apple ID avatar or profile picture.
Open iCloud>Apps Using iCloud>Show All. There should be a toggle indicating “active” for Books. Turn it off/deactivate.
Toggle iCloud>Apps Using iCloud>Show All>Books on.
Check. Depending of the number of books syncing might take a while.
Alternatively you can offload the Books app to iCloud, restart, and reinstall it. As long as you had your ePubs/PDF synced to iCloud before, they will all be available afterwards.
If only ePubs/PDFs are missing which you downloaded/purchased from the bookstore: open Apple’s Books. Click on your avatar/profile in the upper right corner. Tap Books and then Not On this iPad. Select and download the missing books.
EDIT: If you accidently deleted the ePubs/PDFs wich you download/purchased from the bookstore on your Mac, you can recover them from within Apple’s Books as described for the iPad.