Your standing with your faction or your friendship with particular lords seems to be of secondary importance. The marshall isn't always elected, and sometimes the monarch will appoint a new one, especially if the current marshall has been defeated or captured. If you win the election, you become the new marshall and your opponent will like you less (-3). If you are a candidate, the voting will progress in much the same way, except you don't get to cast a vote yourself. If your Renown is high enough, you may be given the option to be a candidate, which you may refuse. The candidate you vote for will like you more (+2) and the one you didn't vote for will like you less (-2), regardless of which one wins. If you are a vassal, you may cast one vote as well. Two candidates will be listed and every other lord of that faction will cast one vote for one of the two candidates. In the original game, the King periodically calls a vote to choose the new marshall.
The title defaults to the Monarch, but will generally be assigned to one of the Vassals of that faction. The Marshall is the military commander of a faction.