Each member of a clan has a ranking in the hierarchy of the clan.
The ranking from least to highest as is follows:
There can be only one leader, one second, two counselors, and five deputies in a clan. As your rank increases you have more commands available to you, type petition to see what is available to you at higher levels.
If and when a clan leader decides to step down or move on, the second will become the clan leader. They then have the decision as to who the next clan second will be.
Some clans also have immortal Patrons. It is within their power to replace the leader at will with their choice and to intervene in clan matters as they feel fit.