We apply gyrokinetic simulations to study pellet induced improved confinement in the TUMAN-3M tokamak. Nonlinear simulations show a clear decrease in transport coefficients due to the pellet injection in qualitative agreement with experimental observations. Neoclassical theory predicts a very steep flow profile in the edge plasma, when the pellet injection changes the collisionality regime from Plateau to Pfirsch-Schluter regime, whereas the simulations predict a gentler flow profile even when the turbulence is neglected. Simulations also show a modest effect of the pellet on the E x B shearing rate. Instead of flow shear, the suppression of transport is thus caused by pellet induced changes in the plasma profiles and especially collisionality. The substantial impact of collisionality on linear growth rates is clearly observed in linear gyrokinetic simulations.