Commentators explain that the song celebrating David's victories was so famous it was known even to his enemies, the Philistines. They quote it here as evidence of his past prowess against them, making him too dangerous to be trusted in their ranks. His reputation, memorialized in song, directly led to his dismissal.