A magnetic field is a force that exists within a given area that is able to attract or repel other magnetically charged objects and electrical particles. There are many potential sources of magnetics fields and they can vary immensely in strength and range. There are also many potential shapes in which magnetic fields are found. The most common and understood shapes are the azimuthal, meridional, dipole, quadrupole, solenoidal, toroidal, poloidal, radial and helical magnetic field shapes.
A magnetic field is comprised of two unique quantities which physicists refer to as B and H. The academic concepts behind B and H are extremely difficult to explain to the layperson and aren't really relevant. Basically, B and H are both vector fields which interact with one another to create a magnetic field. This reaction can either be found in permanent magnetic field that are created by permanent magnets or by those which are created by electromagnets. In truth, however, the exact role of B and H is still being debated by the academic community and no proven answer has yet been tendered as to which of the two are more important or more involved in the creation and maintenance of magnetic fields.
There are many different objects and occurrences that can cause a magnetic field to exist. The most common causes include moving electrical charges (this is how electromagnets work), magnetic dipoles (how most permanent magnets work) and changing electrical fields. It is also theorized that magnetic monopole particles may exist. Though this has not been proven, such particles would possess a magnetic "charge," similar to the way that other particles may possess an electric charge. It also bears mentioning that when a magnetic field is viewed intertwined with an electrical field the resulting product is known as an electromagnetic field.