A 28-year-old patient with a history of intravenous drug use presents with high fever, cough, and pleuritic chest pain. A chest X-ray reveals multiple peripheral nodular opacities, some with cavitation. Which of the following is the most likely underlying mechanism for these clinical and radiographic findings?