The Irish clan system was generally used from the Middle Ages right through until the 17th century and the word “clan” means “family” in Irish. This should give you an indication of what these groups represented. Clans, in general, were collections of people who lived, worked and survived together based on family, territory, interest or kinship connections.
Clan kings “were normally "elected" from any one of the males comprised in the "deirbhfhine", the descendants of a deceased chief through to the fourth generation. Election frequently originated from a council of higher level kings and overlords, and these kings were often "selected" after battling with rival claimants.”