These statements are part of a broader narrative of a "war on cops" carried out by the Obama administration and/or the Black Lives Matter movement, depending on whom you ask. It's certainly true that some shooters of police, such as the Dallas attacker, appear to be motivated by a hatred of white police officers or a twisted urge to seek revenge for police shootings of black Americans. But the simplistic and inflammatory notion of a "war on cops" is completely undercut by one fundamental data point: Intentional attacks on police officers are at historically low levels under President Obama.
Data from the Officers Down Memorial Page, which tracks law enforcement officer fatalities in real time, illustrates the point. During the Reagan years, for instance, an average of 101 police officers were intentionally killed each year. Under George H.W. Bush that number fell to 90. It fell further, to 81 deaths per year, under Bill Clinton, and to 72 deaths per year under George W. Bush.
Under Obama, the average number of police intentionally killed each year has fallen to its lowest level yet — an average of 62 deaths annually through 2015. If you include the 2016 police officer shootings year-to-date and project it out to a full year, that average of 62 deaths doesn't change.
These figures in the chart above include all incidents in which a suspect intended to kill a police officer — shootings, stabbings, assaults, bombings and vehicular assaults. They exclude such things as accidental shootings, job-related illnesses and traffic accidents. If you were to narrow it down to just shootings, the overall trend would be roughly the same: from 80 deaths annually under Reagan to 48 annually under Obama. Again, factoring in the 2016 shooting numbers, including Dallas, has a negligible effect on the average under Obama.
One area where the numbers are a little murkier is ambush attacks such as the Dallas shooting, where killing police officers is the sole intent of the crime. These are generally very rare, with the number of officers dying in these attacks each year in the single or double digits. But they have become slightly more common. During George H.W. Bush's administration (the first administration for which the FBI provides complete data) about eight officers died in ambush attacks each year. That rose to nine under Clinton, and 10 per year under George W. Bush and Obama (through 2014).
The small numbers here make these attacks no less tragic — one dead police officer is too many, regardless of the cause. But they have to be understood in the context of a striking overall improvement in officer safety.
It's tempting to place credit or blame for these figures with whichever president happened to be in charge at the time, as many conservatives have done in recent days. But in reality, police officer safety is much more closely connected to broader social trends than to whomever happens to be sitting in the White House.