Thanks for posting your query.
first I would like to know whether pain is present or not during clicking.
If pain is present ,then it may be due to meniscal tear or arthritis
If pain is not present , then nothing to worry about. Fluid present in the knee to lubricate the joint is consisting of oxygen
, nitrogen and carbon dioxide.
So, often after periods of inactivity or during certain movements these release bubbles which "pop" and crack and is cause for clicking sound.
Hope I have answered your query.