From the article:
Researchers from the Morrison laboratory discovered that forces created from walking or running are transmitted from bone surfaces along arteriolar blood vessels into the marrow inside bones. Bone-forming cells that line the outside of the arterioles sense these forces and are induced to proliferate. This not only allows the formation of new bone cells, which helps to thicken bones, but the bone-forming cells also secrete a growth factor that increases the frequency of cells that form lymphocytes around the arterioles. Lymphocytes are the B and T cells that allow the immune system to fight infections.
When the ability of the bone-forming cells to sense pressure caused by movement, also known as mechanical forces, was inactivated, it reduced the formation of new bone cells and lymphocytes, causing bones to become thinner and reducing the ability of mice to clear a bacterial infection.