Which of the following is the best definition of homeostasis?