What is the role of the bone marrow in the immune system?

The bone marrow is the location of the stem cells that produce all of the cells of the immune system. Some of those cells contribute to innate immunity which provides non-specific protection. In other words innate immune system responds to any foreign cell in the body. The stem cells that produce the cells in the innate immune system are known as the myeloid progenitor cells. The lymphoid progenitor cells give rise to the lymphocytes which make up the adaptive immune system. The adaptive immune system is the system that responds to specific individual pathogens and remembers them so it is ready to mount a very rapid and aggressive response should it encounter the pathogen again.