I buy a gallon bottle of water for 45 cents and vending machines sell bottle water for the same price as soda I think you are going by some weird example because even at gas stations you can buy a large bottle of water for a dollar but soda for almost 3.
As for the small bottle being more than a large it's due to it being cold and people buy them as a last thought sort of thing.
We studied this in my environmental sciences class! Typically you’re paying for convenience and packaging in these cases. For coke to produce smaller bottles it requires more plastic and effort for less product, but they know that if this is in a fridge at the grocery store someone’s buying it for a decent markup cause it’s convenient. The packaging thing is also why you can buy 1 gallon of water for ~50¢ whereas a case of waters runs closer to 3$ and if you were to get those mini bottles of water it’s even more expensive
As for the small bottle being more than a large it's due to it being cold and people buy them as a last thought sort of thing.