It's quite conscious, and I can prove it. I once read a book by an old ref - Mendy Rudolph maybe. He absolutely said there are star calls and the refs do it on purpose. He said 1) stars are who people pay to see,and 2) the stars are better, more athletic, etc so they get the benefit of the doubt.
#2 is the big point here, too. Say you have a borderline offensive foul. The star's driving the lane a little out of control, and the defender's slightly moving. Tie goes to the better player. And here's why:
Say you have those players repeat that same situation (star driving the lane, mid-talent defender trying to take a charge) for you as a ref 1000 times. Every time, there should be a foul called, in either direction. Some of the time, the defender will make it in time to have his feet planted. Other times, he'll be moving and the start will be in perfect control. Most of the time will be somewhere in the middle, like the situation in the preceding paragraph.
If you could have a machine call the clear fouls (the ones at either end of the bell curve), you would see that the defender, who is slower and not as in control of his body as the star, fouls more often... depending on the talent difference, it could be quite a bit more (Ha Seung Jin trying to take a charge off of LeBron James).
So, knowing that less talented players lack the control to do very complicated maneuvers (like taking a charge or tipping a ball away without raking their hand across the ball-handler's arm) mistake-free, in judgment call situations, they are less likely to get a call. In the case of a charge, you may see a lot of no-calls, where the star will have to prove his talent by hitting the shot while leaning around a guy who's in his way. In the case of a handcheck, you might not get a whistle unless possession is lost. When both players are breaking the rules in tiny amounts, the player least likely to commit a clumsy foul is given the benefit.
The nice part about this system is that you can see players improve themselves and drop their foul rate in return. So at least that part of the system generally works.