The best book for this question is: "Seeing Systems" https://www.amazon.com/Seeing-Systems-Unlocking-Mysteries-Or...
It give insights a) on why this happens and b) what scope for action you have (a lot).
ad b) i recommend two sided strategy> continue to do your best work while not caring about it. - and - start "beening open for new oportunities" side project job hunting & networking. it might cost some energy, but either the situation in your job improves and you can keep your job, and if not, you have a head start when your job hunting gets serious.
You might find this book interesting: https://www.amazon.com/Seeing-Systems-Unlocking-Mysteries-Or.... It's a great view into the differing perspectives of executives, middle managers, and ICs.
It give insights a) on why this happens and b) what scope for action you have (a lot).
ad b) i recommend two sided strategy> continue to do your best work while not caring about it. - and - start "beening open for new oportunities" side project job hunting & networking. it might cost some energy, but either the situation in your job improves and you can keep your job, and if not, you have a head start when your job hunting gets serious.