CBD is a cannabanoid that doesn't have the psychoactivity that the cannabanoid THC does. Since it doesn't get you high, it's used exclusively for medicinal purposes. They are both produced by the cannabis sativa
plant, but in different concentrations among the different varieties. Marijuana is the general variety that has high concentrations of THC. Hemp is the general variety that has high concentrations of CBD.
Also, marijuana may include another species of the Cannabaceae family, cannabis indica