The maintenance of a stable internal environment within the body and the mechanisms that regulate it.