airplay is a technology that's built into the ipad and atv2
if your ipad and your atv2 are on the same wifi network, when you play any video or audio on the ipad you'll see one of the options below, which allow you redirect the output to the atv2 (depending on which app you're in)
airplay between an iphone and an atv2 works the same way...
screen mirroring is slightly different though - there's 2 varsions:
1) screen mirroring with a cable - sends the ipad's picture and sound out to any tv via an hdmi input
2) wireless mirroring over airplay - uses the wifi network to mirror the screen, in the same way that standard airplay streams audio/video
maybe check these pages out...
with a cable:
http://www.apple.com/ipad/features/mirroring.html
over wifi:
http://www.apple.com/ipad/features/airplay.html
i only have an atv1 which does airplay but not full screen mirroring, but as i understand it it works in the same way, but it requires that whichever app your using on the ipad has has mirroring enabled.
i'd assume that most apple apps will have screen mirroring enabled, but for other games, media or productivity apps, you'll be relying on 3rd party developers implementing it in their apps. i do know that certain games do it, but i don't know how many other apps can do it. like i say, my atv1 cant do it so i've never really looked into it
hope that helps