To clarify the mechanistic basis for the success or failure of noninvasive ventilation (NIV) in acute hypoxemic respiratory failure (AHRF). We created digital twins based on mechanistic computational models of individual patients with AHRF. Interdisciplinary Collaboration in Systems Medicine Research Network. We used individual patient data from 30 moderate-to-severe AHRF patients who had failed high-flow nasal cannula (HFNC) therapy and subsequently underwent a trial of NIV. Using the digital twins, we evaluated lung mechanics, quantified the separate contributions of external support and patient respiratory effort to lung injury indices, and investigated their relative impact on NIV success or failure. In digital twins of patients who successfully completed/failed NIV, after 2 hours of the trial the mean (sd) of the change in total lung stress was -10.9 (6.2)/-0.35 (3.38) cm H2O, mechanical power -13.4 (12.2)/-1.0 (5.4) J/min, and total lung strain 0.02 (0.24)/0.16 (0.30). In the digital twins, positive end-expiratory pressure (PEEP) produced by HFNC was similar to that set during NIV. In digital twins of patients who failed NIV vs. those who succeeded, intrinsic PEEP was 3.5 (0.6) vs. 2.3 (0.8) cm H2O, inspiratory pressure support was 8.3 (5.9) vs. 22.3 (7.2) cm H2O, and tidal volume was 10.9 (1.2) vs. 9.4 (1.8) mL/kg. In digital twins, successful NIV increased respiratory system compliance +25.0 (16.4) mL/cm H2O, lowered inspiratory muscle pressure -9.7 (9.6) cm H2O, and reduced the contribution of patient spontaneous breathing to total driving pressure by 57.0%. In digital twins of AHRF patients, successful NIV improved lung mechanics, lowering respiratory effort and indices associated with lung injury. NIV failed in patients for whom only low levels of positive inspiratory pressure support could be applied without risking patient self-inflicted lung injury due to excessive tidal volumes.