Background Ventilator-associated pneumonia (VAP) is a frequent nosocomial infection in patients undergoing cardiac surgery, contributing to prolonged hospitalization and increased healthcare burden. This study aimed to evaluate the impact of VAP on clinical outcomes and identify independent risk factors in cardiac surgical intensive care unit (CSICU) patients, leveraging real-world data from the Medical Information Mart for Intensive Care IV (MIMIC-IV) database. Methods A retrospective cohort analysis was conducted on 5,975 patients receiving invasive mechanical ventilation in the CSICU, with VAP cases identified using ICD codes ('99731' and 'J95851'), including 161 VAP cases. Propensity score matching (PSM) was applied to balance covariates. Statistical analyses included Mann-Whitney U and chi-square tests for group comparisons, followed by univariable and multivariable logistic regression to identify VAP risk factors, with model diagnostics ensuring robustness. Results The VAP incidence was 19.68 per 1,000 ventilator-days. Before PSM, VAP patients had higher in-hospital mortality (20% vs. 4%, P < 0.05) and longer ICU/hospital stays. After PSM, mortality did not differ significantly (20% vs. 23%, P = 0.50), but ICU stays (21.47 vs. 13.19 days) and hospital stays (28.38 vs. 18.64 days) remained significantly prolonged (P < 0.05). Multivariable analysis identified aortic aneurysm dissection (OR = 1.61), higher Charlson Comorbidity Index (OR = 1.15), higher positive end-expiratory pressure (OR = 1.28), and higher minute volume (OR = 1.72) as independent risk factors, while higher fraction of inspired oxygen was protective (OR = 0.89). Conclusions VAP significantly extends ICU and hospital stays without increasing attributable mortality in cardiac surgery patients. Key modifiable risk factors include ventilator settings and patient-specific factors. Targeted interventions on these factors may reduce VAP incidence and improve resource utilization.