The major role that the electrification of the energy system is projected to play in the transition to a sustainable economy increases the pressure on the electricity grid and thereby creates a demand for the implementation of smart grid technologies. The interdependencies present in the electricity system require, and have led to, the wide-scale adoption of pilot projects to develop knowledge about the application of these technologies. While the knowledge sharing that stems from these projects is one of the justifications for subsidising these projects, it has remained largely a black box. Based on the analysis of interviews with the project leaders of sixteen smart grid pilot projects, complementary secondary data sources and a survey, we studied knowledge sharing at four levels: intra-organisational, intra-project, inter-project and project-external knowledge sharing. At each level we observed specific sublevels, mechanisms and barriers, resulting in complex knowledge sharing dynamics. While the projects succeeded in developing knowledge, knowledge sharing between projects run by different consortium partners rarely occurred and project-external knowledge sharing was primarily unidirectional and involved generic knowledge. Based on the results a set of recommendations was developed that can stimulate the knowledge sharing and thereby increase the value generated by these projects.