Kola nuts, which contain caffeine, were in the original formulation. It's a stimulant - that's partly what some people are drinking Coca Cola and similar drinks for in the first place. It wasn't added later to increase sales.
Right, but nowadays there's no reason for it to be in there. You said they're marketed as a treat, and optimized to be as delicious as possible. So what's the caffeine for then? They're not marketed as energy drinks or designed to be as stimulating as possible.
I say that the caffeine is in there solely to keep people addicted to it even more.