There are three different coloured cone cells on the human retina, red, green and blue.
When red and green are equally stimulated we see yellow.
When green and blue are equally stimulated we see cyan.
When red and blue are equally stimulated we see magenta.
When they're all equally stimulated equally we see white.
A blue filter blocks all other colours except blue.
A red filter blocks all other colours except red.
A green filter blocks all colours extepr green.
The above filters are addivite primary colours, they are used for mixing light, if you look at a TV screen closely then you'll see rows of red, green and blue dots.
A yellow filter blocks blue and passes only red and green.
A magenta filter blocks green and passes only red and blue.
A cyan filter blocks red and passes only green and blue.
The above filters are subtractive primary colours, they are used for mixing pigments, you'll often see them printed on the corners of magazines or packaging and if you looked at the pages through a microscope you'll see that all the images are made of these three colours.
Putting a magenta filter on top of a yellow filter gives red, because the magenta filter blocks green and the yellow fliter block blue leaving only red because the only colour that they both pass is red.
Putting a cyan filter on top of a yellow filter gives green because the yellow filter blocks blue and the cyan filter blocks red, leaving only green because the only colour the both pass is green.
Putting a magenta filter on top of a cyan filter gives blue because the magenta filter blocks green and the cyan filter blocks red leaving only blue because the only colour they both pass is blue.
https://en.wikipedia.org/wiki/Color_theory