I believe that this serves two purposes:
1. It's the classic give-and-take. You scratch my back, etc., etc.
2. By giving credit out to other people, you create an association with them and whatever you're working on, so that when something inevitably goes wrong, the chain of involvement is so complicated that the fingers don't point squarely at you as the culprit.
I would be careful about being too lenient with giving out credit, however. In my personal experience, you want the people deciding who gets laid off to perceive you as someone who the company would go bankrupt if they even thought of letting you go (assuming bankruptcy is what they're trying to avoid).
And if you can't do that, the moment that economic turbulence hits, you have to start seeking out jobs from a place of strength (i.e., already having a job) before they lay you off and put you in a more desperate situation of having to seek a job while unemployed.