Most astrophysical systems, e.g. stellar winds, the diffuse interstellar medium, molecular clouds, are magnetized with magnetic fields that influence almost all of their properties. One of the most informative techniques of magnetic field studies is based on the use of starlight polarization and polarized emission arising from aligned dust. How reliable the interpretation of the polarization maps in terms of magnetic fields is the issue that the grain alignment theory addresses. Although grain alignment is a problem of half a century standing, recent progress achieved in the field makes us believe that we are approaching the solution of this mystery. I review basic physical processes involved in grain alignment and discuss the niches for different alignment mechanisms. I show why mechanisms that were favored for decades do not look so promising right now, while the radiative torque mechanism ignored for more than 20 years looks so attractive. I define the observational tests and outline the circumstances when grain alignment theory predicts that new yet untapped information of magnetic field structure is available through polarimetry. In particular, I touch upon mapping magnetic fields in circumstellar regions, interplanetary space and in comet comae.