The X-ray Emission and the Magnetic Fields of Late-Type Stars