Nitrogen (N) and phosphorus (P) losses from farmland pose a significant threat to non-point source pollution in plateau lakes. Reducing nutrient loss from cropland is essential for the sustainable agricultural and ecological development of plateau lakes. The study aimed to investigate the effects of optimizing irrigation and fertilization on N and P losses based on field experiments and density functional theory calculation. The findings showed that ditch irrigation contributes to N and P leaching through their interactions with water and colloids, while drip irrigation reduces the transfer capacity for N and P by decreasing the intensity and volume of leachates. Additionally, changing from conventional fertilization to multiple fertilization based on the nutrient needs of corn significantly improved fertilizer efficiency, resulting in reductions in N and P losses of 25.2–72.4% and 24.2–67.6%, respectively. Additionally, the optimization of irrigation and fertilization led to an 11.3% improvement in crop yield. These results contribute to a better understanding of the mechanisms through which agricultural practices affect nutrient losses and have significant implications for optimizing farmland management in the Erhai Lake basin. Importantly, this research is of great significance in mitigating the threat of agricultural non-point source pollution in ecologically fragile plateau lakes.