A pretty simple speculative in-universe explanation is that it uses roughly the same technology as the holodeck. It's already a technology that exists on the Enterprise, and the viewscreen wouldn't have to really be as complicated since nobody has to interact with it physically.

I'm not aware of any explanation that's been given in-universe, though.