When we see stars through the Moon, it is not because the Moon is transparent like glass, but rather because the Moon's surface is not completely solid or opaque. The surface of the Moon is covered in a layer of fine dust and rocky material, which consists of small particles and irregularities. These irregularities allow some light from distant stars to pass through and reach our eyes.
The amount of light that can pass through the Moon's surface is relatively small, and it depends on various factors such as the size and distribution of the particles, the angle of incidence of the light, and the atmospheric conditions on Earth. The effect is similar to how you might be able to see the silhouette of an object through a thin curtain or a foggy window.
It's worth noting that when observing the Moon from Earth, the stars we see through it are typically much farther away than the Moon itself. The Moon is relatively close to us compared to the vast distances of stars in the night sky. The light from those stars that manages to pass through the Moon's surface is significantly weakened and scattered, making them appear faint or blurred.
In general, the Moon appears solid and opaque to the naked eye, but its surface contains enough irregularities to allow a small amount of starlight to pass through. This phenomenon is not unique to the Moon; it can occur with other celestial bodies that have similar surface characteristics.