A rank is a promotion from a town governor. There are several ranks, including Admiral, Baron, Colonel, etc. As you attack more ships and cities you will get promoted. Duke is the highest rank. The governor of any city can promote you, and Governor's daughters have a minimum rank required to take them to the ball. Even if you are against a nation's interests, your achieved rank will not go down. For example, you achieve the rank of Duke with Spain but you want to get the same rank with the English as well. You start attacking ships, and you have a bounty placed on your head by the Spanish. When you retire, however, the stated rank will still be the highest you ever achieved with that nation, not your rank with them at retirement.