Why cavities spread and attack teeth?

It's the bacteria! Every cavity in your mouth, has a higher level of bacteria in it that caused the cavity in the first place. Treating the cavities is the best way to eliminate a large portion of the bacteria. If untreated, this large collection of bacteria would be allowed to continue to generate the acid that will allow it to continue to attack, not just the tooth with the cavity, but the teeth adjacent to it.
Mouth bacteria. Cavities happen when acid making bacteria that live in your mouth, get something to eat (they especially love carbohydrates) and are able to settle in pits, by the gum, or inbetween teeth. The acid eats away the enamel of your tooth and makes the cavities. Cleaning your teeth, limiting carbohydrates, and repairing the acids damage with Fluoride can reduce the risk of cavities.