When the hiring market is tight you might keep them on longer and try to mentor them up to par, but when the hiring market shifts and there are a lot of great candidates on the market it's better to let the underperformers go and re-fill those jobs with great performers who are back on the market for whatever reason.
They're still hiring. This is more like cycling out hires that didn't work AND some collateral employees who unfortunately got lumped into those teams and cancelled projects. Often, the great employees who get "laid off" are quickly scooped up by other teams within the company who need their talent. It's not good business to let great engineers go.