You're being downvoted because it is a real thing.
Even US citizens can be strongly encouraged (with threat of detainment) to turn over their electronic devices and surrender their passwords when crossing the border -- and remember, "the border" is legally defined as any location within 100 miles of a point of entry.
From https://www.npr.org/sections/thetwo-way/2018/01/05/576139303...
> CBP agents inspected 30,200 phones and other devices during [fiscal year 2017].
Therefore, it does happen somewhat frequently.