It’s similar to how Miracast and Chromecast work on Windows and Android devices.
AirPlay lets Apple devices such as Macs, iPhones, and iPads stream audio and video over a local network to an AirPlay-compatible receiver device without the need for audio or video cables. AirPlay is Apple’s name for the company’s proprietary wireless media streaming protocol.