I haven't looked into it directly, but each app that is integrated has to have some sort of live link to Apple so that when content is updated, there is no lapse in the integration.
That's basically it in principle. More specifically, each provider makes a catalog available to Apple for inclusion in the TV app. The TV app doesn't query each app, but rather it queries the providers' servers directly. The app is only used to play back the content, which is done by a deep-linked URL, in much the same way you can open videos in the YouTube app directly from Safari.
So as you said, Plex would need to be doing this on behalf of the user to Apple, or directly from a local Plex server to Apple, neither of which seem likely at all. Apple isn't going to want to deal with that.
Yup. The biggest problem is that each library would have to be user-specific. Not everything in your Plex library is going to be available in mine, and vice-versa, so even if a generic catalog was used, it would still need to be tracked for each user since it would be really silly for the TV app to show every possible TV show and movie that
might be in somebody's Plex library.
Realistically, the only way to do this would be to index an individual's Plex library and then store that in the user's iCloud account. That's not an unreasonable approach at all, but it's still a pretty big architectural change to how the TV app works right now, and it's hard to see Apple having any real motivation to do this.
And for it to even work would be dependent on user content meta data being extremely high quality. I don't know how Apple deals with differing meta data from different apps that provide content, but its probably required to be a 90% match or better with Apple's source for the same content.
That would also be a huge can of worms. While the simplest would be for Plex to tie it into the existing metadata services, which should provide a pretty good match — after all, my shows and movies from iTunes that I imported into Plex mostly matched up just fine — there'd be no realistic way for the TV app to handle any custom metadata.
This is the same problem that Plex had with Siri and Universal Search long before the TV app was a thing. In order to call up movies and TV shows by name, there has to be a common database that Siri can work from.
The more I think about it, the more unlikely it seems that this is going to happen in the way that many of us have been hoping for.