Salvador was the capital of colonial Brazil for two centuries and one of the largest slaving ports in the Atlantic world, receiving people from the Bight of Benin and from Central Africa in numbers that made the city and its recncavo overwhelmingly African. Candomble is what those populations built out of what they carried.
The building blocks were the houses, terreiros, each an initiatory community under a mother or father of the saint, with a compound, drums, a calendar of festivals and a body of initiates. The oldest houses still functioning in Salvador were founded in the nineteenth century, and several were led by women whose authority extended far beyond religion into the social organisation of black Bahia. Practice is grouped by nation, Ketu drawing on Yoruba orixas, Jeje on Fon vodun, Angola on Central African traditions, and the groupings are about ritual language and repertoire rather than the ancestry of the members.
Catholic lay brotherhoods gave Africans a legally permitted place to gather, and the identification of orixas with saints allowed public devotion to continue under a Catholic surface. Whether that identification was disguise, genuine double belonging, or something that changed over time is argued about within the tradition as well as outside it, and a movement to remove the Catholic elements has gathered force since the twentieth century. Police permits were required for ceremonies in Bahia into the 1970s, so the persecution is recent history rather than colonial background.