Aerobic granular sludge (AGS) is a layered microbial aggregate formed by the ordered self-assembly of different microbial populations. In this study, the outer layer (OL), middle layer (ML), and the inner layer (IL) of matured AGS were obtained by circular cutting. The adhesion of microorganisms in IL was significantly higher than that in OL and ML during the famine period, while the adhesion of microorganisms in ML and OL was significantly higher than that in IL during the feast period, confirming that the formation of AGS started in the famine period, and the feast period promoted the increase of particle size. Microorganisms in the three-layer structure were highly diverse and rich in genes for cytochrome c oxidase synthesis with oxygen as the electron acceptor. G_Pseudoxanthomonas was the dominant bacterium in OL. Its spatial distribution increased gradually from the inside to the outside. G_Rhodanobacter was the dominant bacterium in IL. Its spatial distribution gradually decreased from the inside to the outside. The microorganisms in IL contained abundant pili genes. During the self-assembly process of particle formation, G_ Rhodanobaker adhered stronger than G_ Pseudoxanthomonas. The interface between aerobic and anoxic was about 0.6 mm away from the granule surface. Combined with the electron mediator properties of the extracellular polymeric substance (EPS) in granules, it was speculated that the degradation of organic substrates located in the anoxic layer relied on EPS as a mediator for long-range electron transfer, and finally transferred electrons to O2. This study provides a new viewpoint on the formation mechanism of AGS from the perspective of the ordered self-assembly of microorganisms, offering a theoretical basis for the optimal selection of culture conditions and the application of AGS technology.