While many of the Virgin Mary's titles originate from specific apparitions, Our Lady of Sorrows is one of her titles that is derived from a biblical passage.
The most direct reference to this title is in the Gospel of Luke, where the prophet Simeon proclaims what will happen to Mary and her son, Jesus.
This one verse highlights the pain that Mary will experience, a pain that will benefit the world.
Furthermore, Mary's sorrows are brought to light when she is standing at the foot of the cross, witnessing the death of her son.
With these biblical passages in mind, it is fitting that Mary would be called, "Our Lady of Sorrows" or "Our Sorrowful Mother."