More sugar we consume more cavities we will get. This is a myth. Actually, the frequency of sugar intake is important than the amount of sugar intake. When we consume anything, bacteria present in our mouth start digesting food and produce acids. Lactic acid acts on the tooth and starts demineralizing it meanwhile buffers present in saliva start neutralizing those acids. This whole process takes 30-45 mins. More frequently we eat more acid production, tooth stays in non-acidic conditions for less time which means more cavities.
Add sugar with your meals doesn't increase the amount of cavities.