Quoting Commentary for I Kings 2:10

וַיִּשְׁכַּ֥ב דָּוִ֖ד עִם־אֲבֹתָ֑יו וַיִּקָּבֵ֖ר בְּעִ֥יר דָּוִֽד׃ (פ)

And David slept with his fathers, and was buried in the city of David.

Chizkuni

ויולד בנים ובנות, “he sired sons and daughters.” The earth filled up with human beings after the deluge, According to an opinion quoted in Bereshit Rabbah as well as in Sanhedrin 69, it was not unusual for eight year olds to be able to ejaculate semen which produced fetuses. When people who had left behind adult children died, their death is often described as שכיבה, “lying down,” whereas when they did not leave behind adult children they are described as “having died,” i.e. וימת. An example of the former is King David, (Kings I 2,10), whereas an example of the latter is his uncle Yoav, or, according to a different manuscript, Job, who did not leave behind adult sons.
Ask a RabbiBookmarkShareCopy

Ibn Ezra

למעצבה תשכבון Ye shall lie down in sorrow. You shall die in sorrow. Comp. וישכב דוד and David slept, that is, and David died (1 Kings 2:10); there are, besides, a great many instances of the use of the verb שכב in this sense.
Ask a RabbiBookmarkShareCopy

Rashi

ושכבתי עם אבתי BUT I WILL LIE WITH MY FATHERS — This ו of ושכבתי is the connecting link with the beginning of the verse above: Put thy hand beneath my thigh and swear unto me that you will not bury me in Egypt. For I must ultimately lie with my fathers (i.e. die as all my fathers have died) and you shall carry me out of Egypt. One cannot say that “I will lie with my fathers” means “make me lie with my fathers in the cave” (i.e. bury me), for immediately after this it is written “And thou shalt carry me out of Egypt and bury me in their burying place”. Further we find that wherever the term “lying with one’s fathers” is used it denotes dying and not burial. For instance, (1 Kings 2:10) “and David lay with his fathers”, and afterwards it states “and he was buried in the city of David”.
Ask a RabbiBookmarkShareCopy