Where is a Bayer filter used?

To limit the upper frequencies to limit aliasing by the imagers

To minimize the amount of infrared light that enters the sensors

This filter allows a single image sensor to be used