Recent spectropolarimetric observations of low-mass stars show that large-scale components of their magnetic fields can exhibit cyclic variations or reversals. This magnetic activity affects detection of exoplanets and estimation of their masses, and so its modelling is particularly important. In convective stellar envelopes, magnetic fields are created through dynamo action - systematic stretching and twisting of magnetic field lines by helical convective vortices. It is yet however unclear how low-mass stars, with their strong convective turbulence and relatively slow rotation, are able to maintain coherent large-scale magnetic activity. In this talk, I will discuss the physical mechanisms that allow magnetic flux to accumulate at large scales in both turbulent and strongly stratified models of stellar convection. In such models, a highly turbulent convective layer is formed at the surface while the deep flow interiors remain rotationally constrained. Using direct numerical simulations of such flows, I will show that small-scale magnetic flux, generated by small-scale turbulence in the outer flow regions with low density, is systematically transported into more quiescent inner regions by global magnetic pumping mechanism. Consequently, the dipolarity of the field at the surface of the domain increases both with enhancement of turbulence and stratification. I will also explore the mechanisms of destabilization of magnetic fields resulting in magnetic reversals, and their dynamical interactions with zonal flows; finally, I will discuss the impact of differential rotation on magnetic fields during star formation. Both processes could be responsible for diversity of magnetic topology and activity patterns observed in low-mass stars.