Literature on technological change has highlighted the importance of the cumulative character of knowledge. Typically, knowledge produced in a technology inspires subsequent knowledge within the same technology. But knowledge spillovers across technologies can also occur, i.e., technologies can benefit from knowledge that originated in other technologies. Such spillovers support technological variety, one potential goal of technology policy. The extant literature on knowledge diffusion, however, has not been able to explain which characteristics of knowledge increase the likelihood that knowledge will remain within its own technological field or spill over to other technologies. To address this gap, in this paper we test a set of hypotheses on how the diversity of prior art and the degree of technological centrality of knowledge affect the subsequent flow of this knowledge within and across technologies. Drawing upon a comprehensive set of more than 40,000 battery patents, we show that knowledge that is based on comparably less diverse previous knowledge is more likely to be related to intra-technology knowledge flows, and less likely to be related to knowledge spillovers to other technologies. Similarly, compared to peripheral knowledge, core knowledge is more likely to go along with intra-technology knowledge flows and less likely to spill over to other technologies. These findings have important implications for the design of science, technology and innovation policy. Policy measures that encourage the development of specialized and core knowledge are likely to foster the development of stable technological trajectories, whereas measures targeted at developing diversified and peripheral knowledge more strongly contribute to technological variety.