I've no inside knowledge on Google, so can't comment on the rationale for selecting those being let go.
From the outside though, Google under Pichai increasingly looks like Microsoft under Ballmer in the late 2000s/early 2010s. Balmer was lauded for delivering good numbers from a dominant market position. That was fine - until it wasn't. Under his watch, Microsoft completely misjudged the internet and totally missed mobile. Gates still smarts about the latter.
Pichai looks like Google's Ballmer. He inherited a cash cow - search was already dominant and both YouTube and Android had been in the stable for ~10 years when he took over. Despite the investment in ML/AI (Google Brain, DeepMind) and notable advances that have come from there (e.g. the Transformer architecture), Google has stagnated with Pichai at the helm. The profit drop is indicative of that. There's only so long you can keep milking the same cow.
Of course, it's rarely those at the top of the tree that go first. Microsoft was staring over the precipice of existence before they finally got rid of Ballmer. OpenAI has grabbed the AI/ML limielight despite much of the formative work coming from Google. The recent "code red" looks a lot like a CEO who's been asleep at the wheel - and someone finally woke him up.
I don't know what's ahead for Google, but I'll wager it'll need a change at the top.