Our eyes have three types of cones, call them L, M, and S (you might think "RGB" but it's really not, but that's not a bad lie to believe). Between L and M, for example, there is a fair bit of overlap. So, these glasses filter out the colors in the middle, where L and M overlap the most. This means that the only colors which make it through are the colors which your eye can distinguish better, making the colors more vibrant.
This works because most colors are a mix of a bunch of different frequencies of light. Say, ROYGBIV. Maybe you have color blindness and a ROY mix looks the same as an OYG mix. These glasses will filter out OY, so you are left with R in one mix, and G in the other mix. These are easier to tell apart.
So, obviously not perfect, but it doesn't need to be. It just needs to be better than what nature gave you (if you're colorblind). It also doesn't work for people with, say, 100% deuteranopia, but most people with color blindness aren't that severe.