The phrase "shedding blood" is a descriptive euphemism used for "killing." AT: "They shed innocent blood when they killed their sons and daughters" (See: [[rc://en/ta/man/translate/figs-euphemism]])
Here David compares their unfaithfulness to Yahweh to the unfaithfulness of a prostitute. AT: "they were as unfaithful to Yahweh as prostitutes" (See: [[rc://en/ta/man/translate/figs-explicit]])