Vitex works primarily by affecting the pituitary gland, which in turn can help regulate the production of certain hormones such as luteinizing hormone (LH). This effect may contribute to balancing the levels of estrogen and progesterone, thereby alleviating symptoms related to hormonal imbalances.