As background, “Beur HaMilot ('Lexical Definitions') is one of three sections of Ralbag's commentary on the Torah.” (source)
Ralbag Beur HaMilot on Torah,
Deuteronomy 17:17:1
ולא ירבה לו נשים ולא יסור לבבו. מגיד שאם ירבה לו נשים יסור לבבו
מהשם יתעלה ומתורתו לרוב נטות מחשבתו על הנשים מצד רבויים הלא תראה כי שלמה שלא קם
כמהו במלכים ושרתה עליו רוח הקודש הטו נשים לבבו והנה המספר המותר למלך לקחת
מהנשים ואינו רבוי ביחס אל המלך י"ח שהרי מצאנו בדוד שהיו לו שש נשים ואמר לו
השם יתעלה ואם מעט ואוסיפה לך כהנה וכהנה ולא התיר לעצמו לקחת יותר ממה ששלח לו
הש"י עם הפלגשי' ושלקח ולזה כאשר הוצרך אל אבישג השונמית לחממו לא לקחה לאשה
ולא ידעה ולזה היה שואל אותה אדוניה בן חגית להיות לו לאשה כי לא לקחה דוד לו
לאשה: (source)
And he shall not multiply wives for himself, nor shall
his heart turn aside. It explains: if he multiplies wives for himself, his
heart will turn away from the Lord — may He be exalted — and from His Torah,
for his thoughts will be increasingly inclined toward the women because of
their number. Do you not see that Solomon — who had no equal among kings and
upon whom the Holy Spirit rested — had his heart turned by women? And behold,
the number permitted for a king to take of wives is not an undue excess in relation
to the king (י״ח). For we find regarding David that he had six wives, and the
Lord, may He be exalted, said to him, ‘If that is too few, I will add to you
such-and-such,’ and he did not permit himself to take more than what the LORD
allotted him along with the concubines he took. Therefore, when he needed
Abishag the Shunammite to warm him, she was not taken as a wife and he did not
‘know’ her; and for that reason Adonijah son of Haggith asked to make her his
wife, because David had not taken her as a wife.