Devotion to St Anne as patroness of childless women goes back to the Middle ages, and clearly has its origin in the legend that Anne gave birth to Mary only after many years of marriage.
The devotion to St Anne as patron of miners appears to arise from the medieval comparison between the Virgin Mary and Christ and precious metalssilver and gold respectively. Anne's womb, therefore, was the source form which these metals were mined.
Of the mother of our Lady nothing is known; even for her name and that of her husband Joachim we have to depend on the testimony of the apocryphal Protevangelium of James which, though its earliest form is very ancient, is not a trustworthy document. The story told there is that his childlessness was made a public reproach to Joachim, who retired to the desert for forty days to fast and pray to God. At the same time Anne (Hannah, which signifies 'grace') 'mourned in two mournings, and lamented in two lamentations', and as she sat praying beneath a laurel bush an angel appeared and said to her, 'Anne, the Lord hath heard thy prayer, and thou shalt conceive and bring forth, and thy seed shall be spoken of in all the world'. And Anne replied, 'As the Lord my God liveth, if I beget either male or female I will bring it as a gift to the Lord my God; and it shall minister to Him in holy things all the days of its life'. Likewise an angel appeared to her husband, and in due time was born of them Mary, who was to be the mother of God.
It will be noticed that this story bears a startling resemblance to that of the conception and birth of Samuel, whose mother was called Anne (I Kings i); the early Eastern fathers saw in this only a parallel, but it is one which suggests confusion or imitation in a way that the obvious parallel between the parents of Samuel and those of St John the Baptist does not.
The early cultus of St Anne in Constantinople is attested by the fact that in the middle of the sixth century the Emperor Justinian I dedicated a shrine to her. The devotion was probably introduced into Rome by Pope Constantine (708-715). There are two eighth-century representations of St Anne in the frescoes of S. Maria Antiqua; she is mentioned conspicuously in a list of relics belonging to S. Angelo in Pescheria, and we know that Pope St Leo III (795-816) presented a vestment to St Mary Major which was embroidered with the Annunciation and St Joachim and St Anne. There is very little to suggest any widespread cultus of the saint before the middle of the fourteenth century, but this devotion a hundred years afterwards became enormously popular, and was later on acrimoniously derided by Luther. The first papal pronouncement on the subject, enjoining the observance of an annual feast, was addressed by Urban VI in 1382, at the request, as the pope said, of certain English petitioners, to the bishops of England alone. It is quite possible that it was occasioned by the marriage of King Richard II to Anne of Bohemia in that year. The feast was extended to the whole Western church in 1584.