Most mobile phones are smuggled in by prison staff, who often do not have to go through security as rigorously as visitors.
Once inside prison walls, the devices end up in the hands of inmates who purchase them with cash, which is also contraband in most prisons.