Medical science treats cancer as a disease in which rogue cells proliferate uncontrollably, running amok around the body. Therapy focuses on killing the cancer before it kills the host. Unfortunately, the emphasis on cancer cells as defective loose cannons is at odds with the stubborn way they outwit both the body's defences and the physician's armoury.

Cancer is such a ruthless adversary because it behaves as if it has its own fiendishly cunning agenda. Cancer cells come pre-programmed to execute a well-defined cascade of changes, seemingly designed to facilitate both their enhanced survival and their dissemination through the bloodstream. There is even an air of conspiracy in the way that tumours use chemical signals to create cancer-friendly niches in remote organs.

In the frantic search for an elusive "cure", few researchers stand back and ask a very basic question: why does cancer exist? What is its place in the grand story of life? Astonishingly, in spite of decades of research, there is no agreed theory of cancer, no explanation for why, inside almost all healthy cells, there lurks a highly efficient cancer subroutine that can be activated by a variety of agents – radiation, chemicals, inflammation and infection.

Cancer, it seems, is embedded in the basic machinery of life, a type of default state that can be triggered by some kind of insult. That suggests it is not a modern aberration but has deep evolutionary roots, a suspicion confirmed by the fact that it is not confined to humans but is widespread among mammals, fish, reptiles and even plants. Scientists have identified genes implicated in cancer that are thought to be hundreds of millions of years old. Clearly, we will fully understand cancer only in the context of biological history.

Two relevant evolutionary transitions stand out. The first occurred over 2 billion years ago, when large, complex cells emerged containing mitochondria – tiny factories that supply energy to the cell. Biologists think mitochondria are the remnants of ancient bacteria. Tellingly, they undergo systematic changes as cancer develops, profoundly altering their chemical and physical properties.

For most of Earth's history, life was confined to single-celled organisms. Over time, however, a new possibility arose. Earth's atmosphere became polluted by a highly toxic and reactive chemical – oxygen – created as a waste product of photosynthesis. Cells evolved ingenious strategies to either avoid the accumulating oxygen or to combat oxidative damage in their innards. But some organisms turned a vice into a virtue and found a way to exploit oxygen as a potent new source of energy. In modern organisms, it is mitochondria that harness this dangerous substance to power the cell.

With the appearance of energised oxygen-guzzling cells, the way lay open for the second major transition relevant to cancer – the emergence of multicellular organisms. This required a drastic change in the basic logic of life. Single cells have one imperative – to go on replicating. In that sense, they are immortal. But in multicelled organisms, ordinary cells have outsourced their immortality to specialised germ cells – sperm and eggs – whose job is to carry genes into future generations. The price that the ordinary cells pay for this contract is death; most replicate for a while, but all are programmed to commit suicide when their use-by date is up, a process known as apoptosis. And apoptosis is also managed by mitochondria.

Cancer involves a breakdown of the covenant between germ cells and the rest. Malignant cells disable apoptosis and make a bid for their own immortality, forming tumours as they start to overpopulate their niches. In this sense, cancer has long been recognised as a throwback to a "selfish cell" era. But recent advances in research permit us to embellish this picture. For example, cancer cells thrive in low-oxygen (even zero-oxygen) conditions, reverting to an earlier, albeit less efficient, form of metabolism known as fermentation.

Biologists are familiar with the fact that organisms may harbour ancient traits that reflect their ancestral past, such as the atavistic tails or supernumerary nipples some people are born with. Evolution necessarily builds on earlier genomes. Sometimes older genetic pathways are not discarded, just silenced. Atavisms result when something disrupts the silencing mechanism.

Charles Lineweaver, of the Australian National University, and I have proposed a theory of cancer based on its ancient evolutionary roots. We think that as cancer progresses in the body it reverses, in a speeded-up manner, the arrow of evolutionary time. Increasing deregulation prompts cancer cells to revert to ever earlier genetic pathways that recapitulate successively earlier ancestral life styles. We predict that the various hallmarks of cancer progression will systematically correlate with the activation of progressively older ancestral genes. The most advanced and malignant cancers recreate aspects of life on Earth before a billion years ago.

Ancient genes remain functional only if they continue to fulfill a biological purpose. In early-stage embryo development, when the basic body plan is laid down (also in low-oxygen conditions, incidentally) ancestral genes help guide developmental processes before being switched off. Every human, for example, possesses tails and gills for a time in the womb. Significantly, researchers have recently identified examples of early-stage embryonic genes being reawakened in cancer.

The deep links between evolutionary biology, developmental biology and cancer have huge implications for therapy, and also provide an unexpected reason to study cancer. By unravelling the details of cancer initiation and progression, scientists can open a window on the past through which we can gain tantalising glimpses of life in a bygone age.