According to Britannica, the holiday has origins in the Roman festival of Lupercalia, held in mid-February. The festival, which celebrated the coming of spring, included fertility rites and the pairing off of women with men by lottery. At the end of the 5th century, Pope Gelasius I replaced Lupercalia with St. Valentine’s Day. It came to be celebrated as a day of romance from about the 14th century.
Although there were several Christian martyrs named Valentine, the day may have taken its name from a priest who was martyred about 270 CE by the emperor Claudius II Gothicus. According to legend, the priest signed a letter “from your Valentine” to his jailer’s daughter, whom he had befriended and, by some accounts, healed from blindness. Other accounts hold that it was St. Valentine of Terni, a bishop, for whom the holiday was named, though it is possible the two saints were actually one person. Another common legend states that St. Valentine defied the emperor’s orders and secretly married couples to spare the husbands from war. It is for this reason that his feast day is associated with love.
Formal messages, or valentines, appeared in the 1500s, and by the late 1700s commercially printed cards were being used. The first commercial valentines in the United States were printed in the mid-1800s. Valentines commonly depict Cupid, the Roman god of love, along with hearts, traditionally the seat of emotion. Because it was thought that the avian mating season begins in mid-February, birds also became a symbol of the day. Traditional gifts include candy and flowers, particularly red roses, a symbol of beauty and love.
https://www.britannica.com/topic/Valentines-Day