The words were written by ex-slave trader John Newton, who was born in London on 24 July 1725. His father was commander of a merchant ship, and young John followed in his footsteps. After his father died, Newton joined the crew on the H.M.S. Hartwich, but deserted after he found the living conditions deplorable. He was recaptured, flogged and demoted from midshipman to common seaman.
After this, Newton spent some time on a slave-trader's ship, learning the trade, and eventually commanding his own trade in slavery. His conversion occurred during a violent storm at sea on 10 May 1748. From then on, he was a changed man, ultimately leaving his sea-going days behind him, and studying to become a minister. He was ordained by the Bishop of Lincoln and given the curacy of Olney, Buckinghamshire. "Amazing Grace" was written whilst he was at Olney, most probably between 1760 and 1770. He could now understand that God's love is for every man and Jesus had paid the price through his death on the cross for every sin he had ever committed. Incidentally, Newton did not write the music, only the words. The origin of the music is unknown, and there have been several speculations about the music. One is that it might have been based on a melody sung by the slaves themselves.
Newton and William Wilberforce eventual prevailed in seeing that slavery was abolished in the British empire in 1833, 32 years before it was finally abolished in the United States in 1865 by the 13 Amendment.