The Fed is quite the rabbit hole to dig into
It’s technically not a government agency - supposed to operate independently and be non partisan though you can definitely argue that line is pretty blurry.
The board of governors are appointed / confirmed by the pres/usg and that body reports to Congress, but the regional arms are basically private and have their own boards appointed by the governors and member commercial banks.
The FOMC handles the monetary policy and it’s made up of the governors and some of the regional presidents.
So the usg/treasury isn’t actually the one buying debt - they’re selling to select banks and the fed makes their purchases in secondary markets from those banks!