Its in a weird situation where it is technically part of the DOJ, but its primary statutory duty is to carry out the orders of the judicial branch: 28 U.S.C. § 566.
It's part of the power separation. Congress makes laws, can impeach the executive, and confirms judges, judiciary interprets laws, orders, and constitution, executive nominates judges, vetoes or signs laws, and enforces them.