To become a mercenary, you need to make a mercenary contract with one of the factions. This will allow you to fight their enemies and participate in sieges, but you will not receive any fiefs like you would if you were a vassal. You may also be expected to recruit more troops into your party.
To make a contract you must ask a vassal of the faction that you want to join if they have a task. There is quite a high chance that he will ask you to become a mercenary if that faction is at war, which you can then accept.
Mercenary contracts last for 30 days in Warband, and can be renewed for another 30 days. The contract can be renewed indefinitely. In With Fire & Sword, the initial contract is 90 days, though renewing it will still be for 30 days. Mercenaries will be paid a random amount every week.
Being a mercenary is a good way to lead-up to becoming a vassal as it allows you to build relations with lords and get renown by participating in faction battles. It also allows you to burn villages and raid caravans, but have your negative relations removed in the peace deal as opposed to being viewed as a bandit. General strategies for being a mercenary rely on the fact that you are not tied to a faction. It is better to hold your men back in battles in order to gain free renown and loot as well as avoiding confronting AI vassals. Raiding is the main staple of a mercenary and it is a great alternative to trading for the early-mid game to build up your enterprises that will finance your later campaigns as a lord or eventually even a ruler of your own kingdom.