A D lens has a microchip that signals the distance of the focused subject to the camera (not sure where the reference to automatic comes from). The camera considers this information when calculating the exposure. In the past few years, Nikon has incorporated the D chip into all its lenses including the less expensive plastic lenses and the more expensive metal lenses. The G lens, incorporates the D chip also, but has no aperture ring. In affect, this makes the lens usable only on camera bodies that have a command dial that allows for the setting of the aperture. Therefore, I would hesitate to say that a D lens has a higher quality than the G lens. Especially since there are a few very inexpensive D lenses on the market. Losing the aperture ring allows the cost of the lens to be lower than if it incorporated the aperture ring.
From the looks of what is coming down the pike for Nikon lenses, it might appear that the G lens may not stay an inexpensive lens, and might be the wave of the future, as far as Nikon lenses go (who knows, the competition might start dropping the aperture ring in the future). For someone who is used to changing the aperture with the front sub-command dial as I am, the lose of the aperture ring is immaterial, as long as the lens is of quality build.
For others, the loss of the aperture ring seems to be a serious fault, and has been discussed in great depth on another thread.