I suppose Pinkerton was also well known for providing Lincoln's security detail.
Okay, I'm going to preface this by apologizing up front for the vague answer, which is: it depends. I'm going to limit my answer to the Pinkertons specifically, as they are who I have read the most about, but depending on the era and region we're talking about, who the Pinkertons were, where they came from, and how they cooperated with local law enforcement (if at all) varied.
For context, let's start with a little background on Allan Pinkerton himself, because despite what you might think of him, he led a hell of an interesting life. Originally from Scotland, and known to be a hard-working, diligent self-taught/made guy, Pinkerton started his detective career as a low-level informant who partnered with local police to catch low-level crooks. This developed into a job as a detective in the mid-west, which evolved into his forming of his own detective agency in the 1850s. He got some high-profile business from the railroads (he helped them track down and apprehend train robbers), which connected him to a railroad executive named George McClellan, who by late 1861/early 1862 was the most powerful man in the U.S. military.
McClellan admired the zeal and thoroughness Pinkerton exhibited in his railroad detective work, and put him in charge of scouting operations for the Union army during the U.S. Civil War. Here's the rub, though: Pinkerton was terrible at the job. A tenacious and work-working detective, sure, but Pinkerton was absolute shit at large-scale military intelligence work. He didn't know how to accurately count large bodies of soldiers, and was even worse at determining their movements via an analysis of cavalry detachments and reinforcement placements. As a result, Pinkerton routinely exaggerated Confederate army sizes, and worse, incorrectly predicted the enemy's intentions on many crucial occasions (I could go into this more, but I'm trying to keep this whole thing moving towards OP's questions, which I promise, I will get to! = ). This played into McClellan's already cautious nature, and that general's willingness to assume the worst when facing an enemy. For example, even though McClellan could have crushed the Confederates' lines during the Battle of the Seven Days or Antietam via sheer force of numbers, he hesitated due to Pinkerton's faulty intelligence, which told McClellan that the general was facing WAY more troops than he actually was.
As a result, Pinkerton was used less and less as a military intelligence officer and more as a security liaison during the war. Even so, the guy remained paranoid, and prone to fits of delusion about grand Confederate plots, etc. Interestingly enough, the one plot that really WAS in the works near the end of the war (Booth and his conspirators) went completely over Pinkerton's head, and as we all know, led to the assassination of Lincoln.
I think this is important because it informs modern scholars about the nature of Pinkerton's personality. He started as a low-level narc of sorts, and used a J. Edgar G-man approach to policing that held a person's character as paramount. Pinkerton was straight-laced but ruthless, and just wore criminals down: it was what he was good at. To this end, he hired men of questionable character in some cases, but who were on the "right" side of the law in that they were chasing clear-cut, easily defined criminals (his detectives operated more in the grey area). Pinkerton and his detectives routinely intimidated witnesses (often by force), crossed jurisdictional boundaries, and generally did whatever it took to get the job done. Sometimes this was successful (see the Steunenberg murder investigation), and other times it wasn't (see Jesse James). More often than not, though, the Pinkertons got the job done, or at least ran off anyone who was getting in the way of that objective.
To answer the question about their relationship with law enforcement, it was usually pretty cozy. Pinkerton detectives worked closely with the Philadelphia P.D. to track down and capture H.H. Holmes, for example, and usually in strike-breaking situations, the company that hired the Pinkertons were in bed with local law enforcement to some degree (the more rural the area in question, the more cozy they were in most cases).
As for the detectives themselves, their backgrounds varied, but most often, they were people with a police or private detective background. Some were scouts or veterans of the Union during the Civil War (it would have been rare for Confederates to have been hired), but pretty much all of them shared Pinkerton's straight-laced, dogged approach to detective work. For more info on these detectives, look up Frank Geyer, Charles Siringo, or James McParland: these are three great examples of the kind of people Pinkerton liked to use.
[Sources: Bruce Catton, 'Mr. Lincoln's Army'; Doris Kearns Goodwin, 'Team of Rivals'; Richard Slotkin, 'Gunfighter Nation'; Erik Larson, 'Devil in the White City'; David Distler, 'Anarchy in the Heartland']
To add to this question, was there any sort of certification to become a private detective at that time or could one simply claim to be a private detective without any official certification.