Because AirPlay is specifically optimised for Mac/iPad/iPhone to Apple TV and it all runs custom software/firmware. As soon as a third-party who doesn't have access to this comes riding into the equation, you get lag and latency. There's no way of doing this as smoothly. There's lots on Google about it though.