Red, Yellow and Blue are not the "primary" colors!
Red, Green and Blue are the primary colors for light. Cyan, Magenta and Yellow are the primary colors for pigments, such as paints or inks.
You can also say RGB are the "additive primaries", meaning that the more you add of them, the closer they get to white. Turn them all off and you get black.
CMY are the "subtractive primaries", meaning that the more you add of them, the closer you get to black. Turn them all off and you get white (meaning you get the white canvas or paper with no paint or ink.)
Red, Blue and Yellow are not the primary colors for paints, and I really don't understand why paint sets still come with these colors. Red cannot be primary, because you can mix it by mixing together magenta and yellow. Try it! And you cannot mix magenta in any way using paints or inks. Same for blue. It can be made by mixing cyan with magenta, so by the definition it cannot be primary.
(Now, you may have been fooled by a dark-looking cyan in your paint sets. Often cyan is passed off as blue. They are very close looking. And also since we're used to cyan passing off as blue, it's even easier to claim a dark cyan as blue. But if you get a good pure cyan and a good pure magenta, you can mix equal parts and get blue.)
RGB and CMY are opposite primaries too. Meaning, each are the opposite
colors of the others. To find a color's opposite is easy: mix the other two
together. Red is the opposite of green and blue, or Cyan. Green is the
opposite of red and blue, or Magenta. Blue is the opposite of red and green,
or Yellow. You can "test" this by staring at any of these colors for a full
minute then look away at a blank sheet of paper. You will see the opposite
Red is the opposite of cyan
Green is the opposite of magenta
Blue is the opposite of yellow
You can convert one to the other by taking the inverse of the opposite color, meaning the more red you have, the less cyan. This is how you convert RGB colors on a computer screen to CYM pigments in a color printer. The only way the colors wouldn't match well would be physical artifacts: ink impurities, non-linear density of the ink as you increase the darkness of a color, how light or dark the room is when looking at the screen or the printout, and so on.
In fact, if you look at the source code for this web page, you'll see:
<br><font color="FF0000">Red </font> is the opposite of
<font color="00FFFF">cyan </font>
<br><font color="00FF00">Green </font> is the opposite of
<br><font color="0000FF">Blue </font> is the opposite of
<font color="FFFF00">yellow </font>
You can see the FF's (F is 1111 in binary) are all on for the additive primary, and off for it's opposite. This is converting RGB to CMY in the computer.
Why does this work?
In our eyes, we have cones and rods. Rods sense merely light intensity, whereas cones sense colors and intensity. Cones are more centered in the middle of the eye where we need the detail. Cones don't react as well in dim light. This is why we lose color vision at night.
There are three kinds of cones. Red, Green and Blue cones because they roughly react most strongly to these three colors. However, it is not a spike for each of these colors, but a gaussian curve, or a "bell curve". Meaning each cone overlaps the others somewhat. Red cones react to magenta, red, orange, yellow and a little in green, with the peak reaction near red. Green cones react to a little bit of orange, yellow, green, cyan, and a little bit of blue, with the peak near green. Thus, the brain sees yellow as a reaction from both red and green cones at the same time.
The brain cannot distinguish the difference between both red and green turned on, or simple yellow by itself. If you think about it, this is similar to hearing a note D if C-sharp and E-flat are played at the same time -- if I play C-sharp and E-flat, you don't think I played the single note D [you hear both notes at once] but if I display red and green, you do see one color: yellow! Kinda strange!
Our ears have a hair for each frequency we can hear, but our eyes have only three cones to see all the colors we see -- it has to guess that when the red and green cones are sending a signal that they are seeing one color: yellow; instead of two colors: red/green.
But thank goodness it works this way! Because we couldn't mix paints to get other colors -- we'd have to have an infinite number of tubes of paint. We couldn't have color printers for the same reason. Or color TV. But because our eyes work this way, we can trick the eye into seeing color with a much smaller set of colors -- we can make color TV with only red, green and blue dots; we can have color printers with cyan, magenta, yellow and black [we have to add black because the inks aren't dark enough to make a really strong black], and we can buy a few tubes of paint to make a painting of a rainbow [though some artists buy 100's of tubes of paint anyway. :) That's mostly because it's hard to mix the exact same color every time...]
[And thank goodness our ears don't work that way, because we'd only be able to hear one note at a time... No harmonies, no symphonies, just one wavering note.]
Artists who have studied color theory tend to argue with me about this, but a fact is a fact: this is how our eyes work. Aesthetics and science often do not agree. :)