Bat Sheva prayed that her son, Solomon, be wise and fitting for prophecy. David's other wives prayed that their sons be fitting to rule.
King Solomon begins the last chapter of Proverbs with his mother's exhortation to him as a young man.
She begins by saying to him, "What, my son? And what, the son of my womb? And what, the son of my vows?" The following verse, "Give not your strength to women…," we discussed above.
She begins with three questions, what? and what? and what? What have you done to yourself, to your soul (as vested in your body)? What have you done to the origin of your soul (your soul as vested in your mother's womb, in your soul-root above)? What have you done to God, to whom your mother vowed?
Rashi explains that Bat Sheva spoke these words of chastisement to her son Solomon on the day of the inauguration of Temple he had built for God (thus fulfilling the deepest desire of his father David, who did not himself merit to build the Temple in Jerusalem). On that same day he sinned by marrying the daughter of Pharaoh, which brought him to neglect the Temple service on its very first day (for which reason God decreed that the Temple would be destroyed).
Rashi explains the three questions as follows:
"What, my son?" – don't follow your evil inclination (with regard to women), for if you do it will cause people to hold me, your mother, responsible.
"And what, the son of my womb?" – in the last six months of my pregnancy with you I – unlike the custom of your father David's other wives while pregnant – maintained marital relations with your father for your sake (that you be born agile and alert; marital relations in the last six months of pregnancy are good for the fetus). I had special concern for you when you were in my womb (and my relations with your father were for your sake, not for my physical pleasure).
"And what, the son of my vows?" – all your father's other wives while pregnant vowed (to God, pledging charity or making an oath to abstain from some worldly pleasure in order to merit Divine intervention that they be given their heart's desire) that their sons be fitting for kingship, but I vowed that my son be learned in Torah.
What your father's other wives prayed for was not given them, but what I prayed for – says Bat Sheva in her exhortation to Solomon – was given me, together with what I did not pray for, that you reign after your father.
The lesson: if one desires and pursues power (kingship) it is not given him, but if one desires and pursues the service of his Creator (which begins with understanding God's Torah) then not only is that given him but worldly power and kingship as well.