Al-Ghazali was a leading intellectual in the Islamic world of the 11th Century AD, a philosopher, lawyer, teacher, thinker and mystic who made important contributions to Islamic philosophy and to sharia law. The experts on In Our Time who discussed his life and work were Peter Adamson (LMU in Munich), Carole Hillenbrand (Edinburgh and St Andrews Universities) and Robert Gleave (University of Exeter).
The era in which Al-Ghazali lived was one of political change. The caliphate was beginning to collapse, and the Christian Crusaders were fighting for and conquering parts of the Middle East. There was a rump of the old Umayyad caliphate in Spain, and their Abbasid replacement had for a while been a figurehead government with the Shi'ite military holding the actual power. When Al-Ghazali was alive the Shi'ites were in control in Egypt, but the Sunnis had restored the caliphate to actual power in the east (where Al-Ghazali lived). This was an intellectually rich era, with many important and influential scholars. An important piece of context for Al-Ghazali's life and work is that he was born when the translation movement had just finished its project of translating the works of the Greek philosophers into Arabic.
Al-Ghazali was born in the 11th Century in Persia and was of humble origins. He was orphaned, and so doesn't receive his education because of his family connections - instead he is identified as being particularly clever. He was educated in all the subjects that an Islamic intellectual of the era should be - including the Qu'ran and Sharia law. He clearly excelled as when he moves to Baghdad in 1090 he soon gets the best job in the city, when he is still only 33. During the 5 years he lives in Baghdad he is the most senior person in the biggest mosque in the city. His primary duty is teaching, but the role is also a political one - for instance he wrote a tract rebuking the Shi'ite rulers of Egypt.
During his time in Baghdad he writes a work called The Incoherence of the Philosophers which is a rebuttal of the use of Aristotle and the other Greek philosophers in Islamic religious philosophy. this sets him in direct opposition to the leading thinker of the previous generation. The main thrust of his argument is that the Greek notions of causality leave no room for the actions of God in the world. For example if you hold a flame to cotton then the Greek philosophers would say that the fire causes the cotton to burn. But Al-Ghazali believes you need to leave space for God and for miracles. So it is God that causes the cotton to burn when the flame is held to it, and God could choose that the cotton doesn't burn (i.e. a miracle would occur).
Al-Ghazali was also influential in the field of Sharia law. His work on this topic was philosophical in nature and focussed on the principles behind the laws. These are more important than the details of the laws themselves because an understanding of the principle behind a law will allow the law to be adapted to the changing realities of the world.
After he had been in Baghdad for five years he suffered some sort of breakdown. He left the city and his high status job and wandered as a Sufi mystic. Sufism is focussed on a direct personal and mystical connection with God, and this contrasts with mainstream Islam (which focusses on obedience to the laws). Although he lived a life outside the teaching structure of Islam he continued to publish on philosophical matters - now within the Sufi tradition. At the time Sufism was not very closely aligned with the rest of Islamic thought and it was Al-Ghazali's work in this part of his life that brought it and mainstream Islam closer together.
In their summing up at the end of the programme the experts said that although a lot of his writing concerned philosophy (and he played an important role at the time) his lasting legacy is in the field of Sharia law.