Democrats got almost exactly the same seat count in the House both times, and in both cycles they swept the swing state Senate races with one (or two) exceptions. There was churn in how this looked race by race, but 2024 might be easier to understand if the same basic outcome would have happened two years ago too.
You can also see this in exit polling.
2020=17% youth, 34% non-white
2022=12% youth, 27% non-white
2024=14% youth, 28% non-white
The 2024 general electorate was younger and more diverse than the preceding midterm electorate, in line with past cycles. However this time the shift was very small and produced an electorate that was still a lot more like 2022 than 2020. Shifting back to 2020 electorate composition, even with 2024 margins for said electorate, would've produced a Harris popular win, though its effect in the electoral college is less certain.