Afferent lymphatic vessels carry unfiltered lymph into the node. Here waste products, and some of the fluid, are filtered out.
In another section of the node, lymphocytes, which are specialized white blood cells, kill any pathogens that may be present. This causes the swelling commonly known as swollen glands.
Lymph nodes also trap and destroy cancer cells to slow the spread of the cancer until they are overwhelmed by it.
Efferent lymphatic vessels carry the filtered lymph out of the node so that it can continue its return to the circulatory system.