It has to do mostly with severity of crime and how mouch dough you got. A $10,000 bond is gonna keep some poor drug offender in town usually. But to someone like MJ or PS, $10K ain't diddly. The bail is higher.
And oh yeah, the judges discretion, too.
The bail bondsman get's a cut cuz say your bail is a grand, you give him $100 (plus his 15% or whatever fee)and he covers the rest. Then if you don't show, you owe the rest to him. You gotta have some collateral though in case you bolt, like your house, the kid's college $$) But if you do show up, he gets his 1k back plus your fee. Kind of like legal loansharking if you ask me.
Of course, you could just cover bail yourself and pay the whole thing and cut the bondsman out, but if it was that easy to pay, well then that really defeats the purpose of bail....at least in theory I suppose.