The vast majority of people with mental health problems are never admitted to hospital. They may visit their GP and perhaps receive treatment from specialist mental health services, in which case they might see a psychiatrist as an outpatient. Sometimes, but less often, people may be admitted to a psychiatric hospital for treatment on a voluntary basis, where they agree to come in for treatment. Voluntary inpatients have exactly the same rights as anyone going into hospital for any treatment and they can leave whenever they want to.
Alternatively if someone lacks the capacity to consent to being admitted to hospital, but does not object to it, that person might be admitted 'informally'. In none of these cases is the person being compulsorily treated, and in none of these cases are the powers of the Mental Health Act being used.