Totally anecdotal, but I was once pulled aside on the jetway by a woman with a Treasury badge and a burly guy who was probably a sheriff though he never said anything. She wanted to know how much cash I was carrying. I was flying from SF to Frankfurt, and I think it was 1994. My net worth then was about $30k, so I laughed and told her I had about $200 and a credit card.
So maybe CBP doesn't check outbound travelers, but Treasury did at least once.
CBP can and does in fact carry out checks for undeclared cash exports in the jetway for international departures. Not every departure, obviously, and I don't think the selection mechanism is public, but it's a thing they're documented as doing.
You do get searched by TSA if you are coming from outside the country. In recent years I've flown in from Mexico, Spain, India and the Dominican Republic. For each flight, the boarding gate was blocked from general access and the only way to get in was to go through a TSA search. They only had metal detectors, but my bags were still searched. Had I been carrying a large sum of cash (or anything else that needs to be declared) they could have contacted CBP at my departure airport.
That is not the TSA doing the checks though. In Beijing, there is gate screening just as you described, but it is done by locals who don't speak English, and they definitely aren't looking for cash.
Based on reports from flyertalk and other places, it appears that there is a requirement that a certain minimum percentage of US-bound international passengers undergo at least a TSA-style boarding-pass-and-ID check.
Typically this involves stationing agents at the departure gate. Anecdotal evidence suggests AMS is a popular place for this.