There are three types of prisons: state, privately funded, and federal. In the federal system, the levels of security are minimum, medium, maximum, and supermax. An inmate's security level depends on their crime, history, medical needs, psychological needs, and other factors. Despite what you see in the movies, very few supermax facilities exist.
Inmates usually have jobs within the prisons, from tending the landscape to creating furniture for the federal government. There are paint crews, electricians, cooks -- a prison is a smaller version of society with a lot more rules and regulations. There are religious services, commissary (where inmates can order personal items, from ice cream to razors, depending on the security level), a "chow hall," a medical station, and executive offices for civilians who operate the institution.
Inmates have a long time to think - and some of that thinking creates ingenious tools to commit illegal activity, to cause harm, to escape. While incarcerated at Tennessee's Brushy Mountain, for example, James Earl Ray escaped over the fence using a ladder made of short pieces of wood and pipe (he was caught soon afterward).
Here are just a few examples of inmate ingenuity.