David became king because the people of Judah anointed him, which gave him a legal basis for his rule, just as it had for Saul (1 Samuel 11:15). Years earlier, the prophet Samuel had also anointed David, showing that God had chosen him to be king (1 Samuel 16:13).