If you're mixing paints, the primary colors are red, blue, and yellow. If you're mixing colored lights, the primary colors are red, blue and green.
With three simple ingredients, a red, a green, and a blue spotlight, you can make any color of the rainbow. For example, blue mixed with red makes purple. You might remember, however, that every color of the rainbow has its own distinctive frequency, like all the individual notes on a piano.
How does this fit with those primary colors? After all, you can't make every note on the piano by simply mixing the sound from three special keys. If you play a C and an E at the same time, you don't hear a D, you hear the C and the E sounding together. Why do red, blue, and green mix to make entirely different colors, not just chord-like combinations of light?
The answer to this riddle is in our eyes. We see color by mixing together signals from the "cone" cells in our retinas. These cone cells come in three flavors, each particularly sensitive to one frequency of light. Which frequencies are our cone cells tuned to? You guessed it, red, green, and blue.
When we see something purple, we can't sense the purple light directly. Instead, our red sensing cones and our blue sensing cones each respond about half way, and our brain puts this together as purple. You get the same effect by mixing the red and blue spotlight. Those colors don't really mix into purple, they actually make a chord, a distinct combination of blue and red. It's enough to fool your brain into thinking it sees purple!