It does lie with the higher-ups. The engineers don't come to you personally to lay you off. No matter what industry you're in or what justification they have (automation, offshoring, increasing 'efficiency' etc), it's them who pulls the trigger.
Management? The people who are actually financially motivated to cut you loose the first opportunity they get, and aren't just some online "learn to code" edgelords?
Do you think engineers are not financially motivated—in the sense of cutting costs—and wouldn't cut workforce, if feasible?