Owing to the reduction of surface-water resources and frequent droughts, the exploitation of groundwater resources has faced critical challenges. For optimal management of these valuable resources, careful studies of groundwater potential status are essential. The main goal of this study was to determine the optimal network structure of a Bayesian network (BayesNet) machine-learning model using three metaheuristic optimization algorithms-a genetic algorithm (GA), a simulated annealing (SA) algorithm, and a Tabu search (TS) algorithm-to prepare groundwater-potential maps. The methodology was applied to the town of Baghmalek in the Khuzestan province of Iran. For modeling, the location of 187 springs in the study area and 13 parameters (altitude, slope angle, slope aspect, plan curvature, profile curvature, topography wetness index (TWI), distance to river, distance to fault, drainage density, rainfall, land use/cover, lithology, and soil) affecting the potential of groundwater were provided. In addition, the statistical method of certainty factor (CF) was utilized to determine the input weight of the hybrid models. The results of the OneR technique showed that the parameters of altitude, lithology, and drainage density were more important for the potential of groundwater compared to the other parameters. The results of groundwater-potential mapping (GPM) employing the receiver operating characteristic (ROC) area under the curve (AUC) showed an estimation accuracy of 0.830, 0.818, 0.810, and 0.792, for the BayesNet-GA, BayesNet-SA, BayesNet-TS, and BayesNet models, respectively. The BayesNet-GA model improved the GPM estimation accuracy of the BayesNet-SA (4.6% and 7.5%) and BayesNet-TS (21.8% and 17.5%) models with respect to the root mean square error (RMSE) and mean absolute error (MAE), respectively. Based on metric indices, the GA provides a higher capability than the SA and TS algorithms for optimizing the BayesNet model in determining the GPM. © 2021 by the authors. Licensee MDPI, Basel, Switzerland.