While chemical fertilizers can be used to increase crop yield, the abuse of fertilizers aggravates environmental pollution and soil degradation. Understanding the effects of chemical fertilizers on the interaction between arbuscular mycorrhizal fungi (AMF) and pest insects is of great benefit to crop and environmental protection, because AMF can enhance the nutrition absorption and insect resistance of crops. This study tested the effect of different levels of phosphorus, nitrogen, and their interactions on AMF, secondary metabolites, Sitobion avenae in garden, as well as the wheat traits in field. The results showed that AMF colonization on roots in the P0N1 treatment (0 g P/pot, 1.3083 g N/pot in the garden, and 0 g P/plot, 299.84 g N/plot) was the highest in both the garden and the field. The abundance of aphid was reduced in the P0N1 treatment, and there were negative relationships between aphids and AMF and phenolics, but a positive relationship between AMF and phenolics. Our results indicated that a change in the ratio of phosphorus to nitrogen affects the relationship among AMF, aphid abundance, and metabolites. The results also suggested an approach to save chemical fertilizers that could improve crop health and protect the agroecosystem against pollution at the same time.