Why David helped Saul to kill Goliath…
While David was a descendant of the tribe of Judah,Saul was a Benjamite.
Judah had promised his father Jacob to look after the safety of Benjamin when the lad was to go with them to see Joseph in Egypt.
“Then Judah said to Israel his father, “Send the boy along with me and we will go at once, so that we and you and our children may live and not die. I myself will guarantee his safety; you can hold me personally responsible for him. If I do not bring him back to you and set him here before you, I will bear the blame before you all my life.”-Gen 43:8-9
So,prophetically David was redeeming the pledge his ancestor,Judah made for the safety of Benjamin who was the ancestor of Saul by offering to silence the threats made by Goliath to Saul and his army.
It was already written that a Judahite must see to the safety of a Benjamite! Had Saul known that,maybe he wouldn’t have been jealous of David subsequently.
Neither be jealous nor fight what is written.