This story and other mentions of Saul's "mental illness" is a good illustration of how things work.
1Sa 18:6 It happened as they were coming, when David returned from killing the Philistine, that the women came out of all the cities of Israel, singing and dancing, to meet King Saul, with tambourines, with joy and with musical instruments.
1Sa 18:7 The women sang as they played, and said, "Saul has slain his thousands, And David his ten thousands."
1Sa 18:8 Then Saul became very angry, for this saying displeased him; and he said, "They have ascribed to David ten thousands, but to me they have ascribed thousands. Now what more can he have but the kingdom?"
1Sa 18:9 Saul looked at David with suspicion (watch with jealousy) from that day on.
1Sa 18:10 Now it came about on the next day that an evil spirit from God came mightily upon Saul, and he raved in the midst of the house, while David was playing the harp with his hand, as usual; and a spear was in Saul's hand.
1Sa 18:11 Saul hurled the spear for he thought, "I will pin David to the wall." But David escaped from his presence twice.
1Sa 18:12 Now Saul was afraid of David, for the LORD was with him but had departed from Saul.
If Saul was to ask, "Where did this mental illness and torment come from in my life?" it would be traced back to his jealousy and anger over David getting the applause instead of him. Instead of repenting he held onto the anger as a way of feeling superior to David...who he really was afraid of. It is a sad picture of a man who outwardly was of great stature but inwardly was a scared little boy who did not know the Father's love for him.
We see that Saul was the son of Kish who was a mighty man of valor himself....but then we see that Saul was hiding when the people came to make him king. He was a young man who was already broken inside in some way.....possibly from having a mighty warrior dad to live up to.
But for all conditions we all struggle with at times in our minds Jesus is sufficient. He is well acquainted with our sorrows and griefs and pains...He bore them on the cross and He continues to bear them as He lives every moment in you and me.
The thing is we are not any less a citizen of the Kingdom than those who have no illness. It is Jesus who qualifies us not our abilities or performance or the condition of our mind.