Funnily enough, they don’t have blue pigments! I don’t understand the exact physics, but from what I understand they have yellow pigment that lies underneath a layer of cells that reflect blue light back, which combine to make green. But if you were to isolate the yellow pigment it would still look yellow, while the blue reflecting cells only look blue in specific lighting conditions.
They're not illusions, just not colored by pigments.
Pigments absorb certain wavelengths of light, The colors that they do not absorb are what we see reflected off of them.
Blue is generally instead the result of structure rather than pigmentation. The same concept as a crystal prism turning sunlight into a rainbow as the wavelengths travel at different speeds through the crystal structure resulting in slightly different exit vectors.
The structure effectively filters out colors other than blue without absorbing them in the same way as a pigment.