Largely myth. The power of the office is defined by the states. Some states grant considerable authority to sheriffs, others much less.
In my state, Texas, the County Sheriff lives in mortal fear of the Texas Rangers who have statewide authority, and the commissioner’s court that holds the purse strings. Want to see a Texas sheriff sweat bullets, let the rangers drive up to inspect the jail, or catch him/her (Dallas county sheriff is female) waiting to testify before the commisioner’s court to beg for overtime money.
It was unfortunate the Rangers didn’t exercise their authority back in 1993 in the Waco-Branch Davidian debacle. Might have saved a lot of lives. Of course, Ann Richards was Governor then.