A significant improvement of plasma parameters in the optimized stellarator W7-X is found after injections of frozen hydrogen pellets. The ion temperature in the post-pellet phase exceeds 3 keV with 5 MW of electron heating and the global energy confinement time surpasses the empirical ISS04-scaling. The plasma parameters realized in such experiments are significantly above those in comparable gas-fuelled discharges. In this paper, we present details of these pellet experiments and discuss the main plasma properties during the enhanced confinement phases. Local power balance is applied to show that the heat transport in post-pellet phases is close to the neoclassical level for the ion channel and is about a factor of two above that level for the combined losses. In comparable gas-fuelled discharges, the heat transport is by about ten times larger than the neoclassical level, and thus is largely anomalous. It is further observed that the improvement in the transport is related to the peaked density profiles that lead to a stabilization of the ion-scale turbulence.