A better question would be how did Obama win in 2012 with a lackluster recovery and Obamacare a flop.
Because Trump ran on a populist-nationalist platform of non-intervention, less immigration and pro-worker eceonomic policies. Romney ran on the opposite platform — globalist neoconservatism.