This is actually an easy one: Your teeth are formed of VERY hard mineralized enamel, but acid from bacteria release acid, and before that forms a full-blown cavity (and sometimes it never does) the enamel can become porous. Dentin, meanwhile, is already quite porous and sensitive (although, it does not have nerves in it). The pulp, contains very sensitive nerves, for the sake of telling you how hard to chew, rtc.
Of course, if for some reasons your gums are midly inflamed (sub-clinical) it can be enough to expose some tooth surface that is sensitive. There is also the issue that much pain from teeth and the jaw can be referred from or to other regions.
As for sugar, it's a molecular compound, not ionic. That said, Evo is right, this is most likely a cavity which is not yet evident on your x-rays. Remember, a cavity is: a hole, but not JUST that, it's softened and decayed dentin, often beneat a shell of enamel. I would STRONGLY suggest getting this checked on x-ray. If this is a cavity, you do not want it getting close to the pulp... that = a root canal.
If your teeth are healthy, it may be a fluoride rinse could help to reminerlize some enamel, or you may find something like "Sensodyne" useful.