I believe specifically for Epstein's case it was a combination of two things: 1) The "malfunction" of the security cameras outside of his cell, and 2) his seemingly boundless connection to very wealthy and famous people.
1) page 4 of https://oig.justice.gov/sites/default/files/reports/23-085.p...