We present a systematic description of the semiclassical kinetics of two-dimensional fermions in a smoothly varying inhomogeneous magnetic field B(r). We show that the nature of the transport depends crucially on both, the strength of the random component of B(r) and its mean value B. For vanishing B, the governing parameter is α = d/R0, where d is the correlation length of disorder and R0 is the Larmor radius in the field B0, the characteristic amplitude of the fluctuations of B(r). While for α ≪ 1 the conventional Drude theory applies, in the limit of strong disorder (α ≫ 1) most particles drift adiabatically along closed contours and are localized within the adiabatic approximation. The conductivity is then determined by the percolation of a special class of trajectories, the "snake states". The unbounded snake states percolate by scattering at the saddle points of B(r) where the adiabaticity of their motion breaks down. The external field B is also shown to suppress the stochastic diffusion by creating a percolation network of drifting cyclotron orbits. This kind of percolation is due only to the (exponentially weak) violation of the adiabaticity of the rapid cyclotron rotation in the field B, leading to an exponentially fast drop of the conductivity at large B. We argue that in the regime α ≫ 1 the crossover between the snake-state percolation and the percolation of the drift orbits with increasing B is very sharp and has the character of a phase transition (localization of snake states) smeared exponentially weakly by non-adiabatic effects. The ac conductivity also reflects the dynamical properties of particles moving on the fractal percolation network. In particular, we demonstrate that the conductivity has a sharp kink at zero frequency and falls off exponentially at higher frequencies. We also discuss the nature of the quantum magnetooscillations. We report detailed numerical studies of the transport in the field B(r): the results of the numerical simulations confirm the analytical findings. The shape of the magnetoresistivity at α ∼ 1 found numerically is in good agreement with the experimental data in the fractional quantum Hall regime for the vicinity of half-filling of the lowest Landau level.