Three main tribal groups formed the dominate Welsh Kingdoms. The northwest was founded by the post Roman administration of Cunedda and his nine sons. This became the Kingdom of Gwynedd which included "Ynys Mon" [Anglesey]. Vortigern is credited with the foundation of Powys, including what became "Northern Powys" and "Southern Powys". This Kingdom bordered the Anglo-Saxon expansion on the east, and Gwynedd expansion of the west. Dyfed was established by settlers from Ireland with major input from the early Celtic Church. An important religious center, St. Davids, became a strenght to the Kingdom and its founder a patron Saint to the Welsh. Eight smaller Kingdoms, mostly in the south, made up the mosaic of tribes.
You can certainly imagine the task that faced Hywel Dda when in 942 AD, he became the recognized head of Dyfed [905 AD], Gwynedd, and Powys, [942-950 AD]. He is credited with bringing all the lawyers, leaders, and scribes together to clarify the multiple tribal laws. [accepted social conduct]. He of course started with the King and his court! The law reads:
"It is right that there should be twenty-four officers in it:..." [The Court]. It goes own to say, "Three times every year the above twenty-four officers are entitled by law to their woollen clothing from the King and their linen clothing from the Queen - at Christmas, Easter, and Whitsun." The twenty four members as listed were : 1) Captain of the Household, 2) Priest, 3) Steward, 4) Chief Falconer, 5) Court Judge, 6) Chief Groom, 7) Chamberlain, 8) Bard of the Household, 9) Usher, 10) Chief Huntsman, 11) Mead-brewer, 12) Physician, 13) Butler, 14) Doorkeeper, 15) Cook, 16) Candleman, 17) Queen's Steward, 18) Queen's Priest, 19) Queen's Chief Groom, 20) Queen's Chamberlain, 21) Queen's Handmaid, 22) Queen's Doorkeeper, 23) Queen's Cook, and 24) Queen's Candleman. [I had to laugh, being a physician, would place me between the "Mead-brewer" and the "Butler"!]
The information is taken from: "Hywel Dda The Law", translated and edited by Dafydd Jenkins, Gomer Press, 1990. The court is described on page 5. Also: "British Kings & Queens, by Mike Ashley, Barnes & Noble, Inc., 2000. The Welsh Kingdoms are presented starting on p. 121, going through page 164.