Mercenaries were professionals who could be hired as soldiers to fight in a conflict. The negative connotations probably come from the fact that they would simply go wherever the most money was, even if it meant switching sides. They worked for personal gain.