In the early days, Catholics were not allowed to profess their faith openly. So someone wrote this song with two levels of meaning, the surface meaning, plus the hidden meaning known only to the members of their church.
The partridge in a pear tree was Jesus Christ.
The two turtle doves were the Old and the New Testament.
The three French hens stood for faith, hope and love.
The four calling birds were the four gospels of Matthew, Mark, Luke and John.
The five golden rings recalled the Torah or Law, the first five books of the Old Testament.
The seven swans a swimming represented the sevenfold gifts of the Holy Spirit: Prophesy, Serving, Teaching, Exhortation, Contribution, Leadership and Mercy.
The eight maids a milking were the eight beatitudes.
The nine ladies dancing were the nine fruits of the Holy Spirit: Love, Joy, Peace, Patience, Kindness, Goodness, Faithfulness, Gentleness and Self-Control.
The ten lords a leaping were the Ten Commandments.
The eleven pipers piping stood for the eleven faithful disciples.
The twelve drummers drumming symbolized the twelve points of belief in the Apostles’ Creed.