According to Wiktionary a moonroof is a sunroof that has a clear glass panel, rather than being opaque, so that light can enter the vehicle even when the roof is closed.
Wikipedia adds that a sunroof can be manually or electrically powered, but a moonroof is always electric/electronic.
My daughter’s car has both a glass panel that opens and an opaque inner cover, so what does that make it? It also both slides fully open and tilts to vent either to the front or to the back. Volkswagen calls it a sunroof, but it seems to meet the definition of a moonroof.
An interesting bit of trivia: The term moonroof was introduced in 1973 by John Atkinson, a marketing manager at Ford for the Lincoln Continental Mark IV.