Inherited from Latin phlegma. Doublet of flegma, a learned borrowing. For the sense development, compare phlegmatic.
Practice speaking and memorizing "fleuma" and many other words and sentences in Catalan.