I once had a job where I literally had no assignments to work on for weeks at a time, despite my nagging my manager about wanting something to do. I was all but paid to slack off.
My hypothesis of how this came about is (a) they hired me because there was a certain problem (involving one of those Perl scripts that gives Perl a bad name) they needed to solve; (b) once that problem was solved, they had trouble finding something else for me to do whose benefit outweighed the cost of bringing me up to speed on the codebase; (c) despite this inefficiency, no sensible middle-manager in a bureaucratic company will choose to reduce his or her own headcount.
My hypothesis of how this came about is (a) they hired me because there was a certain problem (involving one of those Perl scripts that gives Perl a bad name) they needed to solve; (b) once that problem was solved, they had trouble finding something else for me to do whose benefit outweighed the cost of bringing me up to speed on the codebase; (c) despite this inefficiency, no sensible middle-manager in a bureaucratic company will choose to reduce his or her own headcount.