  M dwarfs are known to generate the strongest magnetic fields among
main-sequence stars with convective envelopes, but the link between the
magnetic fields and underlying dynamo mechanisms, rotation, and activity still
lacks a consistent picture. In this work we measure magnetic fields from the
high-resolution near-infrared spectra taken with the CARMENES radial-velocity
planet survey in a sample of 29 active M dwarfs and compare our results against
stellar parameters. We use the state-of-the-art radiative transfer code to
measure total magnetic flux densities from the Zeeman broadening of spectral
lines and filling factors. We detect strong kG magnetic fields in all our
targets. In 16 stars the magnetic fields were measured for the first time. Our
measurements are consistent with the magnetic field saturation in stars with
rotation periods P<4d. The analysis of the magnetic filling factors reveal two
different patterns of either very smooth distribution or a more patchy one,
which can be connected to the dynamo state of the stars and/or stellar mass.
Our measurements extend the list of M dwarfs with strong surface magnetic
fields. They also allow us to better constrain the interplay between the
magnetic energy, stellar rotation, and underlying dynamo action. The high
spectral resolution and observations at near-infrared wavelengths are the
beneficial capabilities of the CARMENES instrument that allow us to address
important questions about the stellar magnetism.
