An ad server decides which of the ads you have permission to run will actually render.
It stores orders, creatives, and line items. When a slot asks for an ad, the ad server picks among the line items that match: direct sold, house, and anything programmatic that arrived with targeting. Priority and price both matter. The highest CPM does not always win.
The header-bidding auction happens first, in Prebid. The ad server auction happens second, with Prebid's result as one contestant. Publishers most often use Google Ad Manager for this. The ad server is also what finally logs an impression.
You live in it: trafficking line items, pacing orders, and reading delivery. Prebid's hb_ keys are useful only if a line item targets them. No line item, no Prebid win, no matter what the auction returned.
bidtune does not need ad-server access and does not write targeting into it, because the install is the Prebid script.