Moonlighting proteins serve one or more novel functions in addition to their canonical roles. Moonlighting functions arise when an adventitious interaction between a protein and a new partner improves fitness of the organism. Selective pressure for improvement in the new function can result in two alternative outcomes. The gene encoding the newly bifunctional protein may duplicate and diverge so as to encode two proteins, each of which serves only one function. Alternatively, genetic changes that minimize adaptive conflict between the two functions and/or improve control over the time and place at which each function is served can lead to a moonlighting protein. Importantly, genetic changes that enhance a moonlighting function can occur in the gene encoding the moonlighting protein itself, in a gene that affects the structure of its new partner or in a gene encoding a transcription factor that controls expression of either partner. The evolutionary history of each moonlighting protein is complex, depending on the stochastic occurrence of genetic changes such as gene duplication and point mutations, and the effects of those changes on fitness. Population effects, particularly loss of promising individuals due to random genetic drift, also play a role in the emergence of a moonlighting protein. The ultimate outcome is not necessarily the ‘optimal’ solution to the problem of serving two functions, but may be ‘good enough’ so that fitness becomes limited by some other function.