Gemara: [King David asked to know when he would die and was refused.] "Let me know how lacking I am" (Tehillim 39:5). Hashem told him: "You will die on Shabbat."
Ein Ayah: There is a certain effect that the ceasing of an individual’s actions has on the collective. In general, everyone has some influence on the group of people who are close to him. Even if that is a small group, the influence spreads by ripple effect, as people within that group have an impact upon others who are outside the original group. Certainly, the greater a person, the wider his influence will be felt. The influence of King David, as an individual, had a far-reaching but set impact that they were to have.
It is theoretically possible to know when a person would complete the allotted impact he was to have, although it would require Divine Inspiration to be able to know. However, it is impossible to know when the collective influences end and thus to know when the reason for the person to continue living will cease.
This situation is analogous to giving someone specific information that lacks significance because more general information is missing. For example, it means little to know what day of the month something will happen if one does not know the month or the year. In our context, it is possible to know when the person has completed his task from an individual perspective, but that does not provide a full picture because there are many things on the collective level that are impacted by the person as long as he is alive. These matters can remain important to the collective and the way they need to carry on their collective life in a way that they are impacted by the important individual. That is why Hashem was willing to tell David when he would die, from a specific perspective (i.e., the day of the week – Shabbat), without completing the picture clearly from a more general perspective by saying when that day would end up occurring.
This teaches an important lesson. A person’s individuality is never lost within the greater picture of the collective, as we see in the case of David. David’s value was connected to the service of Klal Yisrael, and thus he was an individual who was as connected as possible to the collective. Death is a positive development from the personal perspective of the righteous person, who receives a rest full of reward. On the other hand, his death is a cause of despair and pain for the circles he leaves behind.
If his individual interests would have to give way to the needs of the collective, David should not have died on Shabbat, because the nation was to be thereby pained at an inappropriate time. However, this is not what Hashem prescribed. To the contrary, the person’s individuality remains, just that this power impacts on the collective. At the end of David’s life, it was his individual side that was prominent, which shows that for eternity the individual concerns will continue on, with all their impact on eternal moral completeness. To reinforce this message, David, the King of Israel who will rule eternally, was told that he too would die on Shabbat to show the importance of the positive rest that his death would bring him as an individual.