We've seen in the films, TV shows and games that clone troopers have rankings generally displayed on their armor via colors and accessories. But if all the clone troopers are essentially the same, how do they pick one to be the leader?
As we see in episodes of the Clone Wars like Clone Cadets, the clones are genetically identical, but they are not all equally skilled.
The clones begin training together and will be split up and assigned based on their individual aptitude.
Clone troopers were subjected to intense combat training exercises in order to prepare them for war. As trainees, they held the rank of clone cadet and were organized into multiple squads for the purpose of learning cooperation and teamwork.
Each clone has the genetic makeup to succeed or fail, but based on training and specific personality, they may advance through the ranks, or fail out of service entirely.
The clones who failed to complete their training were not allowed to become soldiers. Instead of service in the Grand Army of the Republic, they were given janitorial duties and menial work. The cadets that succeeded were promoted to active duty.