Why do prisoners join prison gangs? The answer lies in the fact that, like everyone else, prisoners respond to changes in costs and benefits. If a course of action becomes relatively more costly, people will do less of it — ceteris paribus — and vice versa. Subjective preferences help people decide how to weigh costs and benefits, and these cannot be ignored when looking at peoples' decisions. It is not helpful to ignore inmates preferences just because we do not share them, and because we are not in a similar situation.

Prison gangs have not always been present in the American penal system so understanding the factors that have given rise to their growth is key to seeing prisoners as rational actors. One explanation for prison gangs is that they provide a service which many prisoners demand.

Prison gangs, for instance, can provide services similar to those offered by government institutions. But those in prison lack formal access to the governance mechanisms that are common on the outside. This absence of an ordinary-style government on the inside of a prison meant informal norm-based systems of behavior were necessary to regulate behavior.

Historically decentralized norms have been sufficient to self-govern prisoners prior to the rise of prison gangs. Norms help to identify what is socially permissible behavior, such as holding the door open for others. In a prison, there is no official law dictating these informal rules, but instead they develop over time, and they are an inexpensive way to govern. This style of governance works until populations get too large and it becomes too costly to remember all the information of what is and isn't acceptable. Organizations can then arise to solve many of the problems norms address, but through centralized processes.

Prior to the 1970s the set of norms that existed in the US prison system is generally referred to as the "convict code," based on the ideals of never helping officials while respecting other inmates. These norms arose as prisoners had to find ways to engage in mutually beneficial behaviors with strangers. Without this, for example, contraband markets would be nonexistent. Prior to the proliferation of prison populations in the 1960s, decentralized punishment mechanisms served as a powerful way to discourage dishonesty. But while populations got larger they also became younger and more violent, breaking down the effectiveness of the convict code.

These shifting prison cultures derailed the convict code and paved the way for the rise of prison gangs.

Gangs do not randomly form and instead fill power voids by creating mutually beneficial bonds between gang members. When normal governance does not work to protect private property rights, organizations can instead offer protection. This happens outside of prison as well: historically, the Italian Mafia is a good example.

David Skarbek in Social Order of the Underworld identifies the Mexican Mafia as the first prison gang, comprised of Hispanics largely from California street gangs. As they moved among prisons in California, their influence spread and other gangs formed for protection and competition in illicit prison markets.

Another factor leading to the formation of gangs is the increasing demand for contraband. According to the California Department of Corrections and Rehabilitation, in 1959 26% of inmates reported a drug addiction compared to 82% in 1978. This large increase was caused in part by President Nixon's war on drugs which restructured many sentencing practices. These inmate consumers offer a massive profit motive for prison drug dealers who must be able to deter opportunistic behavior and ensure quality. Due to the inherent dangers of dealing contraband in prisons, gangs have a comparative advantage in selling drugs over the individual. Gangs are very successful at making credible threats of violence to deter opportunistic behavior while enjoying extensive trafficking networks, benefiting from underworld economies of scale.

Prison gangs have many trading problems and solve them in a similar fashion to medieval towns. Medieval merchants typically were unsure of the trustworthiness of other traders, unaware of future transactions, and had no way to tarnish the reputation of dishonest traders. This was overcome with the community system where individual reputations were based on the reputation of their respective communities. This encouraged impersonal exchange and monitoring the behavior of your peers. Prison gangs serve the same purpose by facilitating trade with unknown partners based on gang reputations. The free rider problem arises in this situation where people will try to falsely claim membership for benefits. For this many different signals exist to distinguish members from non members, handshakes and tattoos being strong examples.

With the large prison populations and competing factions it should maybe come at no surprise that gangs have a strong foundation in race. Race is something that is very easy to identify and incredibly difficult to change. In a place where everyone is dressed the same 24 hours a day, race offers a cheap method of identification. Groups could have formed around other similarities, such as religions. But non-race-based methods are much more difficult to learn and identify, making race one of the strongest ways to distinguish communities. Inmates with no previous racist behaviors are thrown into a segregated world and have to adapt or suffer. Skarbek, again in Social Order of the Underworld, suggests that new inmates are often approached within days of their arrival to inform them of the rules.

Prison gangs today play an important role in penal life. Gangs allocate valuable resources, such as recreational space. Some areas are preferred over others for quality of equipment or strategic reasons. Gangs often see violence as an effective way to resolve conflict over the use of such common areas. This further incentivizes gang membership for individuals to help time pass more comfortably. Prison gangs are also in charge of their members behavior, and it is in their best interest to maintain a healthy collective reputation — even if that means being feared. Punishment has internal mechanisms inside of gangs to resolve conflicts and disputes between individuals as well as in illicit markets. Due to the existence of these markets and the profitability of trade gangs have an incentive to actually minimize violence. Violence attracts attention and hinders ability to carry on normal operations, making nonviolent solutions the most profitable.

While gangs do provide many of the same functions as mutual aid societies they undeniably engage in a number of predatory acts as well. Rising populations and changing demographics have eroded the effectiveness of the convict code and gave rise to the status quo. Gangs did not just come about, but rather met the demand for governance while also increasing the efficiency of the contraband market. Understanding supply and demand factors helps us understand why prison gangs exist and why rational actors will engage in seemingly senseless acts. Afterall, it is not from the benevolence of the gang member that inmates expect their contraband, but from their regard to their own self-interest.