Following the laws we learned regarding the Kohen Gadol, we arrive at Tractate Sanhedrin, chapter two, Mishnah 3, which deals with the king's participation in a funeral and the mourner's meal.
"Meis lo meis - eino yotzei mipesach paltorin shelo" - if his relative dies, he does not go out of the door of his palace:
If one of the king's seven close relatives passes away, the Mishnah establishes that he is forbidden to leave the door of his palace. The reason for this is the honor of the monarchy: it is not fitting for the people to see the king in a state of mourning and sorrow, unkempt and broken.
"Rabbi Yehudah omer: Im ratzah latzeis achar mitaso yotzei" - Rabbi Yehudah says that if he wants to go out after his bier, he may go out; he disagrees and holds that he has permission to go out. He brings a proof for his words from an explicit precedent: "Shekein matzinu b'David sheyatza achar mitaso shel Avner" - for we find regarding David that he went out after the bier of Avner. King David himself participated in Avner's funeral, and was seen by the people immersed in sorrow and mourning, as the verse states: "Vehamelech David holeich acharei hamitah" - and King David walked after the bier.
Background to these events - the episode of Avner's killing:
After the death of Shaul, the land was divided, and in practice, two kings reigned in Israel:
King David: Reigned over Yehudah from Chevron, and his army commander was Yoav.
Ish Boshes ben Shaul: Reigned over the rest of Israel, and his army commander was Avner.
About two years later, Avner sought to mend the rift and unite the nation. He approached David to resolve their differences and join his side. Yoav was supposed to welcome him, but he had an unsettled score with Avner, who had killed his brother Asael, and even though he was not permitted to do so - he killed him.
David's participation in the funeral stemmed from two reasons:
Personal sorrow: David was grieved by the deed, saw it as a terrible injustice, and was deeply disturbed by it.
Fear of civil war: The people assumed that David was the one who authorized Avner's killing, and this did not bode well for the unification of the two sides.
The Sages' response - a temporary ruling:
To this the Sages respond that one cannot learn from this incident, since it fell under the category of a temporary ruling - an exceptional and temporary ruling due to urgent circumstances, and in this case, the fear of civil war. "Lo hayah hadavar ela lefayeis es ha'am" - the matter was only to appease the people; his participation did not stem from personal mourning or honor, but rather to appease the people and preserve their unity. Therefore, it is an exception rather than the rule, and the halachah was ruled in accordance with the Sages: the king does not participate in funerals.
"Ucheshemavrin oso" - and when they provide him with the meal of condolence:
The Mishnah moves on to the meal of condolence - the first meal that a mourner eats after the burial of his deceased relative, and even the king is fed from the food of others and not from his own resources. Here, the question of the honor of the monarchy arises once again, since the law of overturning the bed applies to the king as well, and we want him to step down somewhat from sitting on his royal throne due to his mourning.
How, then, do we reconcile these matters?
The Mishnah states: "Kol ha'am mesubin al ha'aretz, vehu meisev al hadargash" - all the people recline on the ground, and he reclines on the dargash. The comforters sit on the floor itself, below the king who remains above them, while the king lowers himself from the royal throne and reclines on the dargash. The dargash is a type of small, simple bed, an ornamental bed, which the Gemara explains was meant to bring a good omen to the house. It is not an actual bed or couch for sitting, but rather a simpler piece of decorative furniture. Thus, the king goes down one level to express his mourning, yet remains seated in a dignified manner above the people.