When we AirPlay the online stream on iPad to Apple TV, does the iPad remain in the chain (online stream to iPad and then iPad to Apple TV) or does the Apple TV virtually get and play that stream (online stream to Apple TV)?
If you stream a video from the internet, and then AirPlay is to a suitable receiver like an Apple TV, then all the devices in the chain still take part. The Apple TV doesn't simply get the stream location and other data like playback location, then stream it by itself, it get's a secondary copy that the iPad is essentially repeating onwards.
You can easily test this by streaming something, then airplaying it to the AppleTV, then turning airplane mode on the iPad - the Apple TV stream should fail.
AirPlay works as follows: there is no handoff, the iPad pushes data to AppleTV the entire time AirPlay is engaged.
iOS will connect to AirPlay receivers and offer to mirror the screen. If the application that you run is programmed to do other things, it can then send different content to the TV, continue to mirror and do things like play in the background. If the app you use is simple or doesn't implement Apple's more advanced AirPlay features, then you will get the default mirror behavior without the app maker needing to take any step whatsoever.
For some apps with AirPlay integration, the app will send the link for the video stream to the Apple TV which will then connect to the internet to play the content. I used a WiFi sniffer during AirPlay, which showed minimal wifi activity from my iPhone and considerate internet usage from the Apple TV. It also showed that the Apple TV was using the internet to stream a MP4 video. However, when I tried putting my iPhone into airplane mode, after a few seconds the video cut showing that a connection between the Apple TV and device is needed to play the video.
I'm not 100% sure what the op means by "AirPlay online stream". If you mean something like YouTube or some other app- or browser-based content, the iOS device is definitely in the loop.
If you mean for iTunes-purchased content, there is a way to "stream from iCloud", but it's not terribly clear either. There's another thread on this site about iCloud streaming: How does Airplay from iCloud actually work?
A good link to have basic idea about how apple TV with airplay works!