One of the major variables affecting yield of the mushroomAgaricus bisporusis the casing layer, which directly affects the productivity and mass. Here, volatile organic compounds were extracted by headspace solid-phase microextraction and high-throughput sequencing was used to analyze the microbial community diversity. The relationship between mushroom yield at different cropping stages and the contents of volatile organic compounds and microorganisms in three different casing layers: peat, peat + soil and soil were systematically evaluated. The result shows that Benzaldehyde and (E)-2-octenal which stimulate yield, obviously increased as mushrooms grew, while 3-octanone, which inhibits yield, decreased over time in all three casing layers. However, there was not a strong correlation between the concentration of volatile compounds and yield. In addition, more than 3,000 bacterial operational taxonomic units (OTUs) by performing high throughput sequencing of the microbes were obtained in the three casing layers. Interestingly, the microbial community compositions were very similar between the three casing layers at a later cropping stage, but the community richness varied significantly in different casing layers and at different cropping stages. At the phylum level, the communities had similar structures but were quantitively very different, and this was even more obvious at the genus level. Principal component analysis revealed significant alterations in microbial community structure in different casing layers.Sphingomonas,DongiaandAchromobacterwere the dominant genera at cropping stage 1, and the stage 3 were abundant inSaccharibacteria_norank, Pseudomonas,FlavobacteriumandBrevundimonas, which was positively correlated with yield, while the abundance ofPseudomonasat stage 1 andLactococcusandBacillusat stage 3 was negatively correlated with yield. These results provide a guide for the development and agricultural application of microbial agents for yield improvement in the production ofA. bisporus.