How do bone spurs develop?

The formation of bone spurs can be said to be the result of a self-protective response of the body.
Bones and joints form a complex mechanical system.
After a certain age, as a person ages, the structures that keep the joint stable, such as muscles and ligaments, become lax, the stability of the joint decreases, and changes in joint mechanics occur, promoting the formation of bone spurs.
Bone spurs form in order to regain joint stability and in this sense there is some benefit to the formation of bone spurs.