Depending on the company, management and situation - you are the first to experience the loss in the form of being replaced with a younger, more naive candidate or an outsourced dev shop that can keep the product long enough for management to get another round of funding or find themselves an exit that minimizes their losses.
To not share in the losses you need to make yourself essential and irreplaceable, which is more and more difficult since a lot of the popular frameworks and cloud services that make developer/devops jobs easier also make them an easily replaceable part.
To not share in the losses you need to make yourself essential and irreplaceable, which is more and more difficult since a lot of the popular frameworks and cloud services that make developer/devops jobs easier also make them an easily replaceable part.