This is the part the really got to me once I started to realize that my contributions started really impact a team in a positive way, but the vast benefit of that impact was bestowed upon the manager. More annoyingly, even when the manager was poor ( and, I do not understand why, there seem to be a lot of those around ), the blame was always that of underlings. I was under clearly deluded impression that leaders gets blame and glory.
In my corporate life, I saw total of two exceptions to that rule ( now and my previous boss ).
That's the exact opposite of what a good manager would do. They'd take the blame for things that go wrong and credit the team for everything good that was accomplished. They'd be an advocate for their team and their reports individually. I've been fortunate to work with a few of those managers and they've been the ones that have been really successful long term. Keep searching or take the management route yourself and show them. It's very rewarding!
Managers gets promoted by getting credit for accomplishments, any manager who got promoted a few times will be good at getting credit for what you do in some way or another. Some deserve the credit, others don't.
In my corporate life, I saw total of two exceptions to that rule ( now and my previous boss ).