Metaphor for a rare event, or lunar calendrical term
A blue moon refers either to the presence of a second full moon in a calendar month, to the third full moon in a season containing four, or to a moon that appears blue due to atmospheric effects. The calendrical meaning of "blue moon" is unconnected to the other meanings. It is often referred to as “traditional”, but since no occurrences are known prior to 1937 it is better described as an invented tradition or “modern American folklore”. The practice of designating the second full moon in a month as "blue" originated with amateur astronomer James Hugh Pruett in 1946.
https://en.wikipedia.org/wiki/Blue_moon