It was originally part of the Coca Cola formula and was removed because it is the psychoactive ingredient. They still use coca extract in Coca Cola, but it no longer makes you high.
Unrefined coca is less stimulating. Seeing as refined cocaine was being used in products marketed to infants and children and well understood (by professionals at least) to be fantastically habit forming, I think the pivot to caffeine was somewhere between 99-100% influenced by the impending narcotics regulations.
https://www.answers.com/Q/Is_cocaine_a_hallucinogen_stimulan...
It was originally part of the Coca Cola formula and was removed because it is the psychoactive ingredient. They still use coca extract in Coca Cola, but it no longer makes you high.
https://www.snopes.com/fact-check/cocaine-coca-cola/