I researched this quite a bit for a guide I wrote on laptop border searches several years ago.
The U.S. government agencies with border search authority, especially ICE and CBP, claim the power to search both people who are arriving and departing the U.S. under that authority. They've decided to exercise this power much more regularly for arriving travelers than for departing travelers, in particular by physically making everyone pass through a CBP immigration and customs control checkpoint when they arrive in the U.S.
But they claim the power to do exactly the same kinds of examinations for people who are leaving the country; they just do this so rarely that they haven't built physical facilities to interview or search departing travelers on a large scale.
My impression is that they believe this authority commences when you begin the process of leaving the country, probably by checking in for your international flight. I don't know how that would work if you have a domestic connection prior to the international departure (if they would think they could perform a border search in the first airport or only in the second airport). Yes, that does mean that a CBP or ICE agent could come find you at the TSA checkpoint or, more likely, in the departure area or at your boarding gate and search or question you. This is true even if there are other passengers in the same terminal who aren't traveling internationally; whether the passengers are treated as subject to the border search authority could depend on where they're individually going, not just what physical part of the airport they're in.
I've never heard of this happening, but the agencies have policies for doing it.