You're looking at several different aspects. You'll have a drug leader who won't necessarily involve himself directly in bringing the drugs into the institution, although he will involve his community contacts. He might be talking to his wife to make arrangements for things to be dropped off.
Obviously somebody in the community is going to have to get those drugs, whether they're doing it because they're being muscled or whether they're doing it because they're getting money themselves. It could be girlfriends. They're going to have to have contact with drug suppliers on the outside.
Those drugs are then going to have to get in somehow, and they could get in with an inmate work gang, for instance. That's a group of individuals who are working out in the community. There could be pressure to have a family member of an inmate bring them into the institution. There might be staff corruption, simply paying enough money to have a staff member bring those drugs in.
It could be done through a transfer by an individual who goes to a program at an adjacent minimum security institution, for instance, and then returns to the medium security institution.
This is actually a relatively simple model. I've had much more complex models of actual drug transactions, but they usually involve multiple individuals in the community and within the institution. It's very rare that we'll see one person bringing drugs in just for their own personal use.