Mental illness describes any one of a number of disorders that have a clear effect on a patient's personality or behavior, but have no clear pathology. For example, dementia is not a mental illness because during an autopsy, it can be determined from damage to the patient's brain not only that the patient suffered from dementia but what the underlying cause was (e.g. Syphilis, Alzheimer's disease).
However, in a disease such as schizophrenia, although there are clear clinical indications the patient has a disease, and clear diagnostic criteria for diagnosing it, there is no indication in a dead patient during autopsy that the patient ever suffered from any disorder related to the brain.
Sometimes mental illnesses are actually symptoms of other disorders or illnesses. For instance hypothyroidism can cause depression... or rather include sympotms of depression. This makes it important to rule out or at least consider other disorders-- in this case hypothyroidism-- before diagnosing someone with a true mental illness. Drugs and medications as well as withdrawal from them can also cause side effects that are similar to mental illnesses.
Many forms of mental illness are still poorly understood. Some mental illnesses, like clinical depression and schizophrenia, have recently been shown to be related to the uptake of certain chemical transmitters in the brain, and there are pharmaceutical treatments that improve the condition of most patients. However, the cause of most mental illnesses still remains a mystery. For example, it is not unusual for one of a pair of identical twins to become schizophrenic, while the other shows no sign of the disease. However, it is also clear that mental illness does have a genetic component, as it does tend to run in families.