From the summary of Special Counsel Investigations: History, Authority, Appointment and Removal (R44857, Mar. 13, 2019):
The Constitution vests Congress with the legislative power, which includes authority to establish federal agencies and conduct oversight of those entities. Criminal investigations and prosecutions, however, are generally regarded as core executive
functions assigned to the executive branch. Because of the potential conflicts of interest that may arise when the executive branch investigates itself, there have often been calls for criminal investigations by prosecutors with independence from the executive branch.
In response, Congress and the U.S. Department of Justice (DOJ) have used both statutory and regulatory mechanisms to establish a process for such inquiries. These frameworks have aimed to balance the competing goals of independence and accountability with respect to inquiries of executive branch officials.