There are multiple missing things for this:
1. Layoffs happened regardless of visa status, so visa workers were part of the layoffs.
2. The visa applications for H1B could be for workers already working in the company under a different visa like TN or F1
3. The positions affected by layoffs and positions filing for H1B could be different. For example, a front end position may be affected by layoffs, but the visa application could be for an ML eng.
4. Visa could also be for more tenured staff. Plenty of companies are now only hiring staff+ roles after the layoffs
5. Because of the lottery system and how it works, you could have filed for a visa before a certain date but then before the visa was picked, the worker was laid off. i.e. you filed for a visa in Feb for the April lottery but laid off the person in March, giving the illusion that you filed for a visa after laying people off.