When stationing military on a planet, they will be trained for ship combat. Military do have rank, which initially begins with “none”, but it will go higher the longer the military is stationed on a planet. Stationed military can be trained quicker, and to a higher rank, by building a Military Camp and/or a Military Academy on the planet.
The base training rate of stationed military is 0.1 experience points per turn, and they can go as high as rank 2. Upon researching and building, a Military Camp can train stationed military up to rank 4. It will also double the rate of gaining experience. A Military Academy can train stationed military up to rank 6. It, too, will double the training rate. Thus, having both a Military Camp and Military Academy on a planet will increase the rate at which experience is gained by a factor of 4, and so decrease the time to gain a rank to 25%.
To determine how long until a rank up, simply hover over the soldier. The amount of time to rank up doubles from the previous rank.
You can assign military to do “normal jobs” again, like farmer or worker. They will not lose their rank when doing that. In fact, the rank icon will still be displayed even if they are ordinary citizens. The experience/rank they earn does not affect their production/science/food output.