According to a site i was reading, you were right about the kola nut, it naturally contained caffeine--but it appears they've stopped using them for most mainstream modern colas... and they indeed are adding the caffeine themselves now. There was apparently a push to eliminate caffeine from soft drinks in the 80s but the pushback from soda companies was that removing the caffeine would alter the flavor of their beverages. It's not a crazy amount, but apparently it's enough that 2 cans/day is enough to create a dependency/addition that can lead to withdrawal symptoms in the absence of further caffeine intake.
So it sounds like they use it to make the drinks extra-addictive which would make perfect sense coming from a company that used to put cocaine in their beverages.
I probably should have looked up the purpose of the caffeine in sodas in the first place, lol