The Medical Termination of Pregnancy (MTP) Act, 1971, provides legal grounds for abortion, acting as an exception to Section 312 of the Indian Penal Code, which criminalizes the act of voluntarily causing a miscarriage.