Graphite deposits result from the metamorphism of sedimentary rocks rich in carbonaceous matter or from precipitation from carbon-bearing fluids (or melts). The latter process forms vein deposits which are structurally controlled and usually occur in granulites or igneous rocks. The origin of carbon, the mechanisms of transport, and the factors controlling graphite deposition are discussed in relation to their geological settings. Carbon in granulite-hosted graphite veins derives from sublithospheric sources or from decarbonation reactions of carbonate-bearing lithologies, and it is transported mainly in CO2-rich fluids from which it can precipitate. Graphite precipitation can occur by cooling, water removal by retrograde hydration reactions, or reduction when the CO2-rich fluid passes through relatively low-fO2 rocks. In igneous settings, carbon is derived from assimilation of crustal materials rich in organic matter, which causes immiscibility and the formation of carbon-rich fluids or melts. Carbon in these igneous-hosted deposits is transported as CO2 and/or CH4 and eventually precipitates as graphite by cooling and/or by hydration reactions affecting the host rock. Independently of the geological setting, vein graphite is characterized by its high purity and crystallinity, which are required for applications in advanced technologies. In addition, recent discovery of highly crystalline graphite precipitation from carbon-bearing fluids at moderate temperatures in vein deposits might provide an alternative method for the manufacture of synthetic graphite suitable for these new applications.