An important step on the road to legal abortions in Britain came in 1938 when Dr Aleck Bourne performed an abortion on a 14 year old girl who had been gang raped in Horse Guards Parade, London by some soldiers. The doctor was arrested and charged with performing an illegal abortion because it had not been done to save the life of the mother (the only permissable reason at the time). He was acquitted after succesfully arguing that it had been neccessary for the mental health and wellbeing of the girl, although carrying on with the pregnancy would not have been physically dangerous to her. This began to open the courts up to the idea that factors other than danger to the physical health of the mother might have a part to play in whether abortions were permissible or not.
The actual act allowing abortion was the Abortion Act of 1967 which arose out a Private Members Bill introduced by David Steele (later leader of the Liberal Party). This set out that abortions were allowable under specific circumstances (physical or mental health of the mother, condition of the foetus etc.) with strict time limits. It was never intended that abortion on demand (e.g just because someone couldn't be bothered to use contraception and found themselves pregnant) would be made legal by this Act but the situation has moved further and further towards this in the years since.