Across the world, efforts to support the energy transition and halt climate change have resulted in significant growth of the number of renewable distributed generators (DGs) installed over the last decade, among which photovoltaic (PV) systems are the fastest growing technology. However, high PV penetration in the electricity grid is known to lead to numerous operational problems such as voltage fluctuations and line congestions, which could be eased by utilizing the reactive power capability of PV systems. To this end, we propose to use artificial neural network (ANN) to predict optimal reactive power dispatch in PV systems by learning approximate input–output mappings from AC optimal power flow (ACOPF) solutions in either a centralized or a decentralized manner. In the case of decentralized control, we leverage Shapley Additive Explanations (SHAP), an explainable artificial intelligence (XAI) technique, to identify non-local grid state measurements which significantly influence the optimal dispatch of each individual system. Both centralized and decentralized ANN-based controllers are evaluated through a case study based on the CIGRE medium-voltage distribution grid and compared to baseline control strategies. Results show that both ANN-based controllers exhibit superior performance, hindering voltage problems and line congestions which are encountered with baseline strategies while recording an energy saving of 0.44% compared to fixed power factor control. By leveraging ANN and SHAP, the proposed decentralized controllers for reactive power control are able to achieve ACOPF-level performance while promoting data privacy and reducing computational burden.