Xenon high-intensity discharge lights use an igniter to produce an electric arc that then vaporises metal traces in the bulb, producing a stable discharge. The high temperature of the electric arc produces a light that lets the driver see better at night.
Mercedes and BMW in the 1990s were the first to use Xenon high-intensity discharge bulbs. They were introduced with the D1 and D2 bases. The former have the igniter built into the base and as of 2011 were no longer in common use. The D2 lights have a separate igniter.
The "R" in D2R bulb types stands for "reflector," which means that the bulb is designed to be used in reflector-type headlights. Reflector headlights use a parabolic reflector to gather and focus the light, and use the black part of the bulb for control. The "S" in the D2S bulbs stands for "shielded," which means the bulb is designed for use in projector-type headlights. Projector headlights use a reflector to gather the light and a lens to focus and control it.
D2S and D2R bulbs are electrically similar and could be used interchangeably, but the bases of D2S and D2R bulbs have slightly different notches; as a result, the bulbs do not fit into the other's socket. A D2C bulb is available in the aftermarket that has notches to fit either the D2R or D2S bases and can be used for either bulb.