(I lost the source for this image, if you know it please email me.)
As with most endocrine pathways, corticosteroids are the result of an endocrine cascade starting with the hypothalamus. The hypothalamus produces corticotrophin releasing hormone (first endocrine). CRH causes the anterior pituitary gland to release adrenocorticotropic hormone (second endocrine), which tells the adrenal cortex to produce and release corticosteroids (third endocrine) such as cortisol. The third endocrine has a negative impact on the first two endocrines, which is to say that it down-regulates its own production. Corticosteroids are produced in response to environmental stress to maximize survival by regulating metabolism and immune response.
This corticosteroid pathway is conserved in both tetrapods and bony fishes (there is a slight difference in that bony fishes do not appear to use aldosterone to the extent that tetrapods do). Only recently have scientists found evidence for corticosteroid pathways in an invertebrate species, the sea lamprey. Lampreys are the closest living relative to the earliest vertebrates, so this provides some evidence that the corticosteroid pathway preceded vertebrate evolution.
In an open-access paper in PNAS, Close et al. identified a specific corticosteroid, 11-deoxycortisol, in sea lampreys. Similarly to vertebrates, this corticosteroid was regulated by the same hypothalamus-pituitary pathway and its apparent function was to mediate the stress response. 11-deoxycortisol is a direct precursor to corticosterone and cortisol, which are the major biologically active corticosteroids in higher vertebrates. This implies that while the endocrine pathway may have preceded vertebrate evolution, the specific enzyme responsible for converting 11-deoxycortisol to corticosterone and cortisol may not have been present.
Derivation of steroid endocrines.
The authors found that the CRH genome in lampreys is 88% similar to that in humans! 11-deoxycortisol suppressed the action of sex endocrines, similar to glucocorticoids in humans and other vertebrates. Lampreys, however, have very low levels of endocrines like aldosterone, which is in agreement with the fact that bony fishes use glucocorticoids in both ion homeostasis and metabolism, whereas tetrapods developed two different pathways for regulating these functions using aldosterone and cortisol. The authors hypothesize that the corticosteroid model in the sea lamprey represents the primitive condition of vertebrates.
Close, D., Yun, S., McCormick, S., Wildbill, A., & Li, W. (2010). 11-Deoxycortisol is a corticosteroid hormone in the lamprey Proceedings of the National Academy of Sciences DOI: 10.1073/pnas.0914026107