As QuickPost notes, Macs, iPhones, and iPads don't natively act as AirPlay receivers, but there are some solutions for some combinations of devices.
Mac-to-iPad:
If your hardware and software are up to date enough, you may be able to use the new Sidecar capability to use your iPad as a second screen for your Mac, including mirroring the Mac screen to the iPad. See how here: Use your iPad as a second display for your Mac with Sidecar - Apple Support
There are also third-party solutions that allow an iPad to control a Mac and view the screen.
iPad-to-Mac:
There are several third-party Mac applications which can act as AirPlay receivers. I played with a few of them before Sidecar came out, but never found one I liked enough to purchase.
iDevice-to-iDevice:
I do not know of a current general solution between iPads and iPhones. There used to be some limited solutions for specific situations; there may still be some for things like using your iPad as a viewfinder for a camera app on your iPhone.