Some products are not selling. Other products become obsolete after some time.
New products come to being. They require new techniques and different skill sets.
A company trying to survive in the IT world needs to lay off teams and re-invent itself every couple of years.
If you don't like it, don't work in IT, don't work in Silicon Valley.