Idiopathic pulmonary fibrosis (IPF), a progressive lung disease characterized by irreversible lung dysfunction caused by fibroblast proliferation and excessive collagen deposition, is the result of persistent chronic inflammation of the lung parenchyma. Although the pathogenesis is not fully understood, the role of immune mechanisms such as innate immune response, adaptive immunity and immune regulation, and cytokines in the pathophysiological mechanism of pulmonary fibrosis has been gradually recognized. There are currently limited drugs available to treat IPF, and long-term use of these drugs may produce many adverse reactions. With the elucidation of the underlying immunological pathogenesis, the development of more valuable drugs targeting the immune system becomes possible. This article reviews the immunological pathogenesis of pulmonary fibrosis and the emerging drugs targeting the immune system in recent years, aiming to provide insights into the mechanism and treatment direction of pulmonary fibrosis.