Because there are many respiratory diseases, infectious, inflammatory, or malignant that can be accompanied by lymph node enlargement and the finding of enlarged nodes can sometimes lead to the most likely cause of the respiratory symptoms.
I hope that you do not have swollen lymph nodes or, if you do, the cause is identified and responds to treatment.
Good luck
They check if they are swollen indicating infection.