This is where the rib meets the sternum near the sternoclavicular joint. There are little 'joints' where the ribs meet the sternum just as there are lateral facet joints where the ribs meet the spine.
There is cartilage at these places, and gas builds up in these places which causes an audible POP when released.
It is nothing serious.
The pain is from the pressure.
The entire thing is likely due to weak and tight chest muscles,.. elongated and weak back muscles -- with likely poor posture. Do you do alot of sitting?
At any rate -- a chiropractor could help with this.. or an ostepath -- I would also recommend stretching the chest and doing some resistance exercises for the back and chest. At a 2 to 1 ratio. Where you do two times the amount for the back as you do for the chest. As you likely have some rounded shoulders, and kyphosis of the back.
When you breath in it is putting pressure in this aforementioned area.. which creates the pain due to surrounding nerves and then the pop which allows the joint to move a bit and releases the nerve pressure temporarily.
The key is to get these supported with stronger muscles and realigned with stretching and manipulation.
Take care,