The Tamil temple is not a building but a walled town, and understanding that changes what the region's religious history looks like.
At Srirangam the complex encloses seven concentric walled enclosures with the shrine at the centre, and people live and trade inside the outer ones. At Madurai the Minakshi temple stands at the middle of the city with streets laid out concentrically around it, and the deity's marriage is re-enacted annually as a civic festival with processions through those streets. The towers over the gateways, covered in painted figures, are later additions that grew taller than the shrines they guard.
Historically these institutions were landlords, employers, banks and courts. Inscriptions cut into their walls, in Tamil and running to many thousands of texts, record land grants, endowments for lamps and offerings, the wages of temple servants, and the settlement of disputes, which makes South Indian temple walls one of the richest archives of medieval economic life anywhere in the world.
They also carried the argument about entry. Access to inner enclosures was regulated by caste, and the campaign to change that ran through the twentieth century; the Temple Entry Proclamation issued in Travancore in 1936 opened state-controlled temples to all Hindus and was a landmark for the wider movement. The temples remain working institutions with tens of millions of visitors, administered largely by state endowment departments rather than by hereditary trustees.