A majority of cellular proteins are translated and folded in the cytosol with the help of molecular chaperones. Just as proteins must be folded to function in the cytosol, proteins in organelles like the endoplasmic reticulum (ER) and mitochondria also must be folded to function. Consequently, specific cellular mechanisms exist that aim to detect cellular stress (causing misfolded/unfolded proteins to accumulate), transduce the signal to the nucleus, and mediate the restoration of protein homeostasis (proteostasis). In the cytosol, the heat shock response (HSR) manages the unfolded proteins through heat shock factor 1 (HSF1). HSF-1 is a transcription factor that, upon increases in unfolded cytosolic proteins, will trimerize and enter the nucleus to upregulate the expression of heat shock proteins (HSPs) that will act as protein folding chaperones.
In organelles like the ER and mitochondria, the response is slightly more complex. Both UPR mechanisms are conceptually similar in that they are activated by the accumulation of misfolded/ unfolded proteins and induce the translational upregulation of molecular chaperones and proteases to process proteins and restore homeostasis.  Despite their names, the two pathways possess distinct initiating stimuli and signaling mechanisms that regulate the responses. The ER UPR is induced by a variety of cellular stressors that inhibit protein folding or exit of the ER. Within the ER GRP78, an ER lumen chaperone, is bound to ER membrane proteins.  When unfolded proteins build up, it dissociates to from the membrane to aid in protein folding. GRP78 dissociation triggers the UPR  that restores protein homeostasis via three pathways (IRE1, PERK, and ATF6). The UPR  restores proteostasis by selectively attenuation protein translation, upregulating protein folding chaperones, and degrading excess misfolded proteins via ER associated protein degradation (ERAD). Prolonged activation of the UPR can result in apoptosis.
The UPR progresses through the bZIP transcription factor ATFS-1 (in C. elegans; ATF5 in mammals).  AFTS-1 is usually imported into the mitochondria where it is degraded by the LON protease.  Mitochondrial dysfunction inhibits this process and allows ATFS-1 to accumulate in the cytosol and enter the nucleus where it can act as a transcription factor. This responses restores proteostasis by upregulating chaperones and proteases, increasing reactive oxygen species (ROS) detoxification, and increasing mitochondrial import machinery.