Rank will probably be awarded through time in service, ability and knowledge.
We have seen enough Trek promotions to tell that this isn't quite true. Different people get promoted at wildly different rates, and to wildly different final ranks, as is
not the case in today's militaries. Also, promotions are handed out as rewards, whereas today's organizations would hand out commendations and decorations.
I could easily believe in a Starfleet system where only people who are
interested in rank get one. If you just want to go to space to do your thing, you will never get promoted to any rank whatsoever. If you want to lead a team of people, you may have to accept some sort of a rank for symbolic purposes, and then you can stick to it till you retire or die. But if your ambition is to command, you probably won't stop at commanding just that initial team, and will climb the ladder till you command entire departments.
And while space assignments aren't a limited resource, department commands are, so you will have to start competing. Which is a good reason for introducing more ranks than just "I don't command", "I command a team", "I command a department" and "I command the whole ship", even if those are the only actual command positions available.
So Starfleet could "keep" the old western naval rank system for competition purposes, but ditch the noncom system that has no practical use because if you are a Starfleet noncom, then you by definition don't command or compete. After all, there supposedly are no salaries, at least not in TNG, and we never learn that salaries would be tied to rank in any of the Trek realms, so that's no reason to covet brass for your collar or gold braid for your sleeve.
Why are many militaries today "up or out" -minded? They invest in the education of their officers, sure, but they wouldn't need to invest for the next-level education of somebody who chooses to stall at a given level. Yet they have few slots available for the beefiest types of assignment, such as unit commands, so if somebody stalls, he either has to be kicked out or bypassed. And bypassing seems to be a strict no-no: a military hierarchy may strive to be meritocratic, but the only way to make that appear even halfway fair is to stick to some sort of formal rules, and steady progression and seniority rules are needed to keep that house of cards from collapsing. Perhaps Starfleet feels it needn't worry, as nobody's pay is in jeopardy there, and injured pride just makes the hurt party strive for even more?
Timo Saloniemi