Bhagavathi is the main goddess in Kerala temples. Here I am trying to explain her entry into spirit worshipping Malayalee society and her higher position over the spirits in the temple.
Kali and Haplogroup R2 people:
Along with rice farming, Y-Haplogroup R2 people brought Kali, an idol goddess, to Malabar(Kerala and Tulu Nadu) regions from Eastern part of India. This Kali was the main goddess of Tantriks(before they became part of either Buddhists or Vaidiks).
Tara and Bhagavathi:
As I have mentioned earlier, just as Tibetan Shamans became part of Buddhism, these Tantriks also became part of Buddhism taking their goddess into Buddhism. The Kali by this time came to be known as Tara in Eastern regions both in Vaidikism and Buddhism(however, the name Kali still used in Vaidikism). I am not sure if Tara in Vaidikism is because Buddhist Tantriks joining Vaidikism or Tantriks -> Vaidik Tantriks -> Buddhist Tantriks (Vajrayana) sequence or
Tantriks(Kali to Tara conversion) -> Vaidik Tantriks and Buddhist Tantriks(simultaneous). But I am inclined to think it should be Buddhist Tantriks joining Vaidiks(most probably Saivites), a pattern that was repeated in Malabar region too.
In the region of Malabar, as Tantriks became part of Buddhism Kali became Bhagavathi. When these Tantriks embraced Vaidikism, Bhagavathi also became "pure and higher". This could be seen in the community temples of Kerala where spirits along with Serpent(which is again a spirit) have shrines outside the Bhagavathi shrine and are mere protectors and equated with Shiva's Ganas. However, in their tribal past Malayalees worshipped spirits(never in idol format) as supreme divine beings. This tradition continued in their Tharavadus, joint family houses, where Korati, a spirit goddess was worshipped.