Your claim is bogus. According to the National Law Enforcement Officers Memorial Fund, 100 cops died last year. And a good percentage of those were from traffic accidents, not being gunned down. And even among those gunned down, many of those were shot accidentally by other cops. So I'm not even sure how many of those 100 could be said to have been "killed" as in "killed by a bad guy".
Meanwhile, every 28 hours a black person in the US is killed by law enforcement or security forces.
Being a cop is a relatively safe job. There are very many more dangerous ones, including construction work, truck driving, garbage collecting, roofing, electrical worker, and aircraft piloting.
Your argument reflects a common belief that police are an embattled and vulnerable population, constantly threatened by danger and persecution. Statistics don't show that reality, but the belief persists because it is politically necessary in order to justify the outrageous use of force that cops routinely employ.
The purpose of police violence is not to keep cops safe. It is to make it easier for cops to do their job, which is to maintain control over society.