Magnetic, electric and gravitational fields are important concepts with similarities and differences. A good understanding of these differences and similarities will deepen the understanding of the three concepts.
A gravitational field is due to any object that has a mass because if you place another object nearby, it will be attracted according to the Newton's law of universal gravitation.
Similarly, any charged object creates an electric field because if you place another charge nearby it will be either attracted or repelled.
A magnetic field is due to magnetic material or to moving charges. If you place a magnet nearby in a magnetic field (near a magnet for example), it will either be attracted or repelled. Moving charges may also be attracted or repelled by magnets.