Dopamine agonists work by binding to dopamine receptors in the pituitary gland, which in turn suppresses the secretion of prolactin. Lower prolactin levels help in restoring normal menstrual cycles, enhancing fertility, and reducing symptoms of galactorrhea.