Virulent biofilms are responsible for a range of infections, including oral diseases. All biofilms harbor a microbial-derived extracellular-matrix. The exopolysaccharides (EPS) formed on tooth-pellicle and bacterial surfaces provide binding sites for microorganisms; eventually the accumulated EPS enmeshes microbial cells. The metabolic activity of the bacteria within this matrix leads to acidification of the milieu. We explored the mechanisms through which the Streptococcus mutans-produced EPS-matrix modulates the three-dimensional (3D) architecture and the population shifts during morphogenesis of biofilms on a saliva-coated-apatitic surface using a mixed-bacterial species system. Concomitantly, we examined whether the matrix influences the development of pH-microenvironments within intact-biofilms using a novel 3D in situ pH-mapping technique. Data reveal that the production of the EPS-matrix helps to create spatial heterogeneities by forming an intricate network of exopolysaccharide-enmeshed bacterial-islets (microcolonies) through localized cell-to-matrix interactions. This complex 3D architecture creates compartmentalized acidic and EPS-rich microenvironments throughout the biofilm, which triggers the dominance of pathogenic S. mutans within a mixed-species system. The establishment of a 3D-matrix and EPS-enmeshed microcolonies were largely mediated by the S. mutans gtfB/gtfC genes, expression of which was enhanced in the presence of Actinomyces naeslundii and Streptococcus oralis. Acidic pockets were found only in the interiors of bacterial-islets that are protected by EPS, which impedes rapid neutralization by buffer (pH 7.0). As a result, regions of low pH (<5.5) were detected at specific locations along the surface of attachment. Resistance to chlorhexidine was enhanced in cells within EPS-microcolony complexes compared to those outside such structures within the biofilm. Our results illustrate the critical interaction between matrix architecture and pH heterogeneity in the 3D environment. The formation of structured acidic-microenvironments in close proximity to the apatite-surface is an essential factor associated with virulence in cariogenic-biofilms. These observations may have relevance beyond the mouth, as matrix is inherent to all biofilms.