While more can always be said, you may find this portion of a previous answer interesting:
The Bureau of Investigation came out of a particularly nasty fight between Teddy Roosevelt and Congress involving the use of the Secret Service to investigate fraudulent federal land sales under the Homestead Acts. In short, there was a massive industry funneling those who had theoretical land rights to consolidators like mine operators who would pay people (often over and over, given lax record keeping requirements - Union veterans were particularly sought after since they didn't have a 5 year waiting requirement to gain title) to grab chunks of land and mineral rights.
There was a extraordinarily brutal case in Oregon Colorado (edit: confused a few details since I'd answered the original question off the top of my head; see below for the corrected, detailed version of all this) where two Secret Service agents along with two other federal employees were investigating a mine shaft that would have proved land fraud by a coal mining company. One man was left up top while the other three went below. When they were done, they discovered the mine shaft exit had been blocked; fortunately one managed to create a hole to get the others out, only to find their colleague had been executed with the intent of letting the three remain trapped below and be dynamited, solving the problems of the mining company who could claim they had sadly died from a gas pocket blowing them up.
The investigation of this led to outrage, which grew even further once the two murderers got off in state court as well as finding out that the murder couldn't be prosecuted federally under existing statute.
This turned into one of the wilder executive-legislative fights, to the point where Congress took the extraordinary step of expunging a message from the President from its records - the first time that had been done since the Polk administration during the Mexican American War.
With Congress not willing to allow any sort of formal consolidated federal investigative branch, Roosevelt snuck in the Bureau of Investigation with a quiet action that wasn't noticed initially by Congress, with the more formal law enforcement powers of it being formalized during World War I and then vastly expanded under Hoover and Prohibition.