Check out the answers in here: Layers and WebXR - #4 by ShawnWhy
Using threejs layers mechanism is probably the most straightforward/readable way…
Looks like layer 1 is rendered for left , layer 2 for right, and 3 is rendered for both.
I think Internally the determination is made by using the XRManager.getSession().getViews() and checking the XRView.eye==‘left’ || ‘right’