It appears that you are using iCloud for Messages on all your devices. In this case, when you delete a message(s) on one device, then it is deleted on all your devices that are signed in to the same Apple ID. You are not going to be able to retrieve those deleted messages at this point. They are gone from your devices and gone from iCloud.
In the past, you were able to keep your messages on your iPad is because you probably had iCloud for Messages set to OFF on both devices You also had (and probably still do)Text Message Forwarding active on both devices. This is the setting that you need to return to.
If you want to keep your messages on your iPad or on your iPhone (Not on iCloud) then set iCloud for Messages set to OFF on both devices OR set it to ON only on the device you want to maintain the messages upon.
Axel F.