Mercenaries are soldiers who give their services, and if necessary, their lives, to anyone who will pay them enough to do so. They were common even in ancient times.
Sometimes they were slaves, as were the Nubians who served the Pharaohs, or freebooters, such as the Philistines who were found in armies throughout the ancient Near East.
In medieval armies, professional soldiers often went to war instead of vassals who owed allegiance to a king or noble. The vassal had to furnish a certain number of armed men to fight in his lord's service for 40 days a year, but an alternative levy of gold was permitted which was used to hire mercenaries.
Mercenaries dominated the turbulent period from the Black Death of the mid-14th Century to the end of the wars of religion three centuries later. The bands which devastated France in the Hundred Years' War (1337-1453) were like those which ruined Germany in the Thirty Years' War (1618-48). The wealthy cities of Renaissance Italy gave them long term contracts for they were tough, skillful men who could cope with any kind of disturbance.
There are still men whose love of adventure and action leads them to enlist with any army who will pay them enough. Many governments, especially those in developing nations, are anxious to pay for their daring and expertise.
Through the ages mercenaries have become heroes, murderers, and the inevitable face of war.