Machiavelli's the Prince, famous for supposedly being a handbook for successful autocrats, has a lot of warnings that are generally unheeded, most notably an admonition for autocrats never to rely on mercenaries:
"Mercenaries and auxiliaries are useless and dangerous; and if one holds his state based on these arms, he will stand neither firm nor safe; for they are disunited, ambitious and without discipline, unfaithful, valiant before friends, cowardly before enemies; they have neither the fear of God nor fidelity to men, and destruction is deferred only so long as the attack is; for in peace one is robbed by them, and in war by the enemy. The fact is, they have no other attraction or reason for keeping the field than a trifle of stipend, which is not sufficient to make them willing to die for you. They are ready enough to be your soldiers whilst you do not make war, but if war comes they take themselves off or run from the foe...."
In short, mercenaries exist and participate in sundry activities just for money. If a mercenary dies, then he/she cannot acquire money and thus the entire enterprise is for naught. So it is in a mercenary's best interest to stay alive. It will be an unscientific generalization to say every mercenary, so let just say for the sake of academic and political correctness, most mercenaries are like that.
So what functions do most mercenaries perform in real life? They suppress, terrorize, and kill ordinary people, who are generally unarmed and thus easy pickings. The brutalities in Tripoli in the past few hours should not surprise any serious student of ethnic conflicts and civil wars, as mercenaries and irregular forces are prevalent in these militarized conflicts. Once the other side organized well enough, however, usually the disciplined army will be able to crush the mercenaries pretty easily. That's why, once the people get organized in Benghazi, the hired mercenaries simply unable to bring the city back under government's control.
Of course, Qaddafi would not have to rely on mercenaries had he developed a very strong military institution in Libya. Unfortunately, his background works against him. Realizing that he came from an institution that was able to topple the old monarchy, it, he decided to disempower the military, unlike other autocrats who created and maintained its power. We cannot say this failed to work, considering the fact that he is still in power for the last 42 years, though his days is most likely numbered now. But during his tenure, he relied more on creating a state where the only certain thing was unpredictability. No constitution, no parties, no powerful military, and everything has been based on tribal loyalties and decrees, as well as by Popular Congresses that mandated every citizen to participate and to debate (a really good but very brief description of how this Congress work can be found in a really good book titled The Media Relations Department of Hizbollah Wishes You a Happy Birthday: Unexpected Encounters in the Changing Middle East (no, we are not paid by Amazon.com, but maybe we should be). By keeping everything in chaos, he ends up as the sole arbiter of power.
On the other hand, when the oppositions get their act together, Qaddafi found that he could rely on nobody aside of a bunch of mercenaries that he shipped from Chad and Sudan, but the again, these people are not particularly reliable.
Furthermore, by bringing in mercenaries. Qaddafi is actually shooting himself on his foot. Aside the fact that they are generally undisciplined and prone to exacerbating problems (witness the indiscriminate shooting in Tripoli and outraged people's reaction in Benghazi, e.g. just burned them to death), the mercenaries actually delegitimize the entire regime. While it is indefensible to have the Chinese soldiers shooting their own people in Tienanmen, apologists can argue that the state was trying to clean up the source of domestic instability and it is the Chinese own business to take care of its own internal business. In Libya's case, having foreign mercenaries shooting on a state's own citizens is just plain stupid, because such acts simply galvanized the population who saw the regime as no longer "one of us." Not surprisingly, Libyan diplomats are abandoning the sinking ship. Regardless of their motives, they are smart enough to understand that there are stark differences between Tienanmen and what is currently happening in Libya.
If the disenchanted masses manage to organize themselves and storm Tripoli, Qaddafi will likely find that his mercenaries will just melt away, especially if they see that they have the opportunity to their home countries.
(If you are still interested in learning more about mercenaries, try looking at John Mueller's The Remnants of War. )