Many Democrats performed better than expected in the 2022 midterm elections, bucking historical trends to hold on to key governor’s offices and House seats and to expand their majority in the Senate.