Grain legumes play a significant global role and are integral to agriculture and food production worldwide. Therefore, comprehending and analyzing the factors that influence grain legume yield are of paramount importance for guiding agricultural management and decision making. Traditional statistical analysis methods present limitations in interpreting results, but explainable artificial intelligence (AI) provides a visual representation of model results, offering insights into the key factors affecting grain legume yield. In this study, nine typical grain legume species were selected from a published global experimental dataset: garden pea (Pisum sativum), chickpea (Cicer arietinum), cowpea (Vigna unguiculata), garden vetch (Vicia sativa), faba bean (Vicia faba), lentil (Lens culinaris), pigeon pea (Cajanus cajan), peanut (Arachis hypogaea), and white lupine (Lupinus albus). Seven commonly used models were constructed for each legume species, and model performance evaluation was conducted using accuracy, AUC, recall, precision, and F1 score metrics. The best classification model was selected for each grain legume species. Employing Decision Tree analysis, Feature Importance Evaluation, and SHapley Additive exPlanations (SHAP) as explainable techniques, our study conducted both individual and comprehensive analyses of nine leguminous crops. This approach offers a novel perspective, unveiling not only the unique responses of each crop to the influencing factors but also demonstrating the common factors across different crops. According to the experimental results, XGboost (XGB) and Random Forests (RF) are the best-performing models among the nine types of grain legumes, and the classification accuracy of a specific species is as high as 87.33%. Insights drawn from the feature importance map reveal that several factors, including aerial biomass, precipitation, sunshine duration, soil conditions, growth cycle, and fertilization strategy, have a pivotal influence. However, it was found from the SHAP graph that the responses of various crops to these factors are not the same. This research furnishes novel perspectives and insights into understanding the factors influencing grain legume yields. The findings provide a robust scientific foundation for agricultural managers, experts, and policymakers in the pursuit of optimizing pulse yields and advancing agricultural sustainability.