moonroofs are not completely water tight so water can seep between the glass and roof but water goes into the channels and then out through the drains. the water wont get inside the car if the drains are kept clean.
theres a part on water management here
Water management theory.
When the glass is all the way forward and in it's "home position", the rubber gasket's primary function is to eliminate noise, and shed most of the rainwater.
Any water that seeps past the rubber gasket is captured into the drain channels, and funneled into one or more of the 4 drain hoses that are leading through through the bottom of the vehicle.