The use of the word “spoil” in “to the victor go the spoils” and “spoiled milk” seems completely different, but does in fact stem from the same root. “To spoil” originally came from Latin spolium, meaning “skin stripped from an animal,” which led to the sense of weapons taken from an enemy. Spoliare, the verb, is from the plural of spolium (spolia), and meant “to strip, rob, plunder, pillage”. Eventually, “spoil” took on the sense of “destroy, ruin,” then later adopted the “spoiled child” usage, and ultimately came to mean “become tainted, go bad”.

Source