The fundamental distinction between public law enforcement agencies and privately-owned and operated security companies is one of the legal authorities that undergird the former and make them directly responsible to the public they serve.
Each city, county, and state government, as well as the national government, has statutory restrictions on what public law enforcement is authorized to do, and have specific guidelines on what they are both expected and legally authorized to do. For instance, the laws of the State of New York authorize city and state police to effect arrests of individuals for violations of city or state statutes, and to detain those individuals consistent with both state and federal authorities.
Privately-owned and operated security companies do not possess the legal authorities associated with public law enforcement agencies, with the one grey-area exception of bounty hunters, whose powers to search a premises and detain an individual exceeds that of regular citizens. They are not law enforcement officers, and are prohibited from acting as such. Private security personnel cannot pull over a vehicle for exceeding the speed limits. They cannot arrest and process through the criminal justice system criminal suspects. And they cannot invade the privacy of citizens, once again, with the exception of bounty hunters attempting to capture clients who have jumped bail.
Private security guards are paid to protect a specific premises or private individual, but are not authorized to make arrests. A massively complicating factor, however, has been the proliferation of privately-owned security companies since the terrorist attacks of September 11, 2001. Since those attacks, the federal government has frequently needed to augment its own law enforcement and military police units with private contractors, often employing former military or law enforcement personnel. These privately-owned security companies have performed military functions in countries like Iraq and Afghanistan, and are used to supplement domestic law enforcement agencies in the United States for special events like the visit of a high-level foreign dignitary, for example, the Pope, during which time they can come in contact with members of the public in such a way that the distinction between official and private becomes blurred.