In Madness and Civilization, Foucault traces a history of madness. His position is that although psychoanalysis and medical institutions have been designed to treat the insane, these institutions have also alienated the insane, physically locking them up, and culturally or conceptually treating them as "other" even to the point of something other than normal humans. Thus, the medical establishment's treatment of the insane has become like humanity's poor and condescending treatment of animals. This is essentially the attitude (of the medical establishment and the culture in general that accepts it) that Foucault criticizes: the idea of treating humans like animals - less than human. He writes:
Those chained to the cell walls were no longer men whose minds had wandered, but beasts preyed upon by a natural frenzy: as if madness, at its extreme point, freed from that moral unreason in which its most attenuated forms are enclosed, managed to rejoin, by a paroxysm of strength, the immediate violence of animality.
Foucault notes that the classical comparison of animality and insanity was quite different than the modern comparison. In the classical, the insane behaved animal-like and this showed their ability to adapt. Foucault provides a few examples from the 19th century, and prior, of mad people who could endure rough conditions, including very cold temperatures. In the modern context, the animality of the insane is not viewed as such; rather, it is viewed as a weakness, as a disease. The only cure, then and now, was discipline and confinement. Thus, the treatment had always been to treat the insane as wild animals, with the more recent (modern) methods of confinement and discipline. This connection between animality and insanity has continued to this day; the insane are still viewed as such:
It was this obsession that created the imagery responsible for all the practices of confinement and the strangest aspects of its savagery.
In the age of reason, that which was associated with reason (law, truth, ethics) became associated with a sane doctrine. Therefore, that which was associated with unreason (the illegal, the false, and evil itself) became associated forms of insanity. So, all those exhibiting unreason (lack of sane behavior/doctrine) had to be confined and "treated."
During the Renaissance, the insane were out in public, in the streets. In this sense, they were viewed (by the "sane") as animals, but left in the public eye. Following the Renaissance, the insane were still in the public eye but behind closed doors. This progression shows how the insane were treated as wild animals, then to being treated as wild animals that need to be locked up. For Foucault, this practice is tied up with ideas from his other work, Discipline and Punish, which deals with the power relations of locking "unwanted" people up under the guise of "treating" them. This has to do with those in power establishing a "normal" code of behavior; anyone who behaves otherwise will be branded insane, criminal, etc. and would be "treated" - in this context, treated like dangerous, wild animals.