It works because the system is faulty in the same way our eyes are faulty, we basically have sensors for three main wavelengths and derive every color we perceive from a mix of those three,
check this out:
https://en.wikipedia.org/wiki/Color_vision#Physiology_of_col...