I was working there when they laid off 18,000 people. Everyone I knew personally who lost their job was rehired by the company within three months. One of them was even rehired to their original team, go figure.
I saw good performers laid off while poor performers kept their jobs. I also saw poor performers rehired. The rumor at the time was that the list of people being laid off was chosen at random. That certainly makes sense, as it would allow the company to say, "We randomly laid off X% of people doing Y work in Z division." in the event of any discrimination or wrongful termination lawsuits.
Companies of this size treat people as cogs in a machine. Provided all your cogs meet a certain minimum standard your machine functions well. If you need to cut down on the number of moving parts, you don't get too concerned over which individual cogs you get rid of. It's horrible and impersonal, but I guess it's somewhat necessary for a company like Microsoft.
Software has so much domain knowledge that there are all sorts of funny memes about what happens whenever the person that originally wrote the code leaves the company.
I don't know who they're laying off but if they worked in, say, ARM Surface Hardware or maybe phone hardware engineering, they're going to have a smaller amount of places to go. Yes they could go learn software development but if they haven't done it that ramp up time is going to be years.
Also, it's worth noting that I'm very familiar with Microsoft.
With programming, I've seen some great work done when good people are tasked with alien problems.
I think the novelty gets people excited again while making them (temporarily) more careful.