Mary Boyce in Zoroastrians p. 130 suggests that the ever increasing religious observances and the clergy's demands for gifts and due may have become oppressive for ordinary Zoroastrians more concerned in surviving and supporting their families. The priestly class had become large-scale landowners and according to Boyce employed peasants and slaves.
Mazdakism may have been a response to an increasingly hierarchical Zoroastrian leadership and one that did not tends to the spiritual and social needs of the more disadvantaged members of society. As we note from Baghdadi's account, it remained one of the four Zoroastrian sects or denominations that continued to exist and influence other sects even after the Arab invasion and occupation.
Primary Source - Shahrestani
Our Primary source for Mazdakite beliefs and cosmogony is its description in the Ketab al-melal wa'l-nenal, written by Abu'l-Fath Mohammad bin 'Abd-al-Karim Shahrestani (pp. 192-94; tr. pp. 663-66) in 1227. The date of this account places in seven hundred years after Mazdak's life. Given this gap in time, we do not know to what extent Shahrstani's explanations coincide with Mazdak's own teachings.
Mazdak is mentioned in Pahlavi writings but only as an object of abuse.
All our information about Mazdak comes from sources not sympathetic to him (including Shahrestani) and we have no option but to rely on the available accounts.
We don't have a date for Mazdak-e Bamdad's birth, we can assume in was in the second half of the fifth century CE/ Mazdak is said to have died between 524 and 528 CE. In his early years, Mazdak was a member of the Zoroastrian priesthood, a mobed (magha, majus مجوس or magus).
Sassanian Patronage - Kavad I
Mazdak was said to have had a charismatic personality and was a persuasive speaker. As had Zarathushtra gained the royal patronage of King Vishtasp and Mani that of King Shahpur I, Mazdak's developed a royal patron in the person of King Peroz's son, Kavad I. The latter succeed to the Sassanian throne in 488 CE. Most nobles, notables and clergy opposed Mazdak fiercely, branding his teachings as heresy. Indeed, surviving Pahlavi texts brand Mazdak as the arch-heretic. Kavad lost support of the king-makers and had to flee his throne in 494, taking refuge with the Hephthalites, the so-called White Huns (in the kuhistans of Khorasan?), the group that his father died fighting and would had previously held him as hostage for a couple of years when Kavad was crown prince. The Hephthalites helped Kavad regain his throne, but having learnt that supporting Mazdak could cause him a lot of grief, Kavad abandoned his support for the reformer.
Towards the end of his reign Kavad allowed his heir apparent, Prince Khosrow to arrange a banquet honouring Mazdak, but one that was a trap to get Mazdak and his followers together so that they could be slaughtered.
The Great Zoroastrian Conundrum
This entire episode would be the start of the great conundrum for Zoroastrians and perhaps the start of the great divisions that would weaken Iranian community and leave it vulnerable to the Arab hordes who would devastate Iran-Shahr a hundred or so years later. On the one hand reform was desperately needed. On the other hand, the reform eventually caused even greater harm and that by the corrupt order.
Survival of Mazdakism
Mazdakism did not die with Mazdak. Indeed, it flourished in the back waters of Iranian society giving rise to other syncretic movements such as the Khurramdin. When opposition and revolts against the Arabs started to sprout a century after the Arab invasion, it was not by mainstream Zoroastrian groups who were hiding in the hills or congregating in Yazd and Kerman. It was the Khurramdins who led the charge, the final and valiant attempt being by Babak Khorramdin.
Shahrestani describe Mazdakite beliefs follows:
God ruled the world through letters, which held the key to the Great Secret that should be learnt.
God had placed the means of subsistence on earth so that people could share in their division equally. But the strong had wronged the weak by seeking domination and thereby causing inequality (cf. Darius' inscription about a just law: "It is not my desire that the weak be wronged by the strong, nor is it my desire that the strong be wronged by the weak, what is right, that is my desire.")
Light and darkness are the two modes of being and principles that existed before the world. Light acts intentionally and voluntarily and is endued with knowledge and perception, whereas darkness acts blindly and at random. Darkness is therefore, ignorant, blind and indiscriminate. The mixture of light and darkness itself came about by chance and at random. At the end of the world the separation of these principles will also come about by chance and not through free will.
From the mingling of the two arose the Manager of Good and the Manager of Evil.
Humankind's role in this life is to release those parts of being that belonged to Light through good conduct. Where Manichaeism saw the mixture of good and bad as a cosmic tragedy, Mazdak viewed this mixture in a more neutral, even optimistic way - as an opportunity.
The three primal elements are water, earth, and fire. The mixture of these elements has resulted in a guiding force of good and a guiding force of evil. However, these forces are not to be equated with the two principles. This is because they effect good and the evil in the elements and can be therefore be regarded as demiurges - creative forces that have formed the world.
Shahrestani next describes the Mazdakite 'object of veneration' and hierarchy. The 'object(s) of veneration' is compared with royal advisors or guiding principles. Human beings like kings have four powers arrayed and available before them: discernment, understanding, preservation or memory, and joy. The four principles are like four courtiers: the Mobedan Mobed or high priest, the chief herbad or wise teacher, the esbahbed / espahdeh / sepahbad or military commander, and the rameshgar or musician / entertainer.
The four powers govern the world through seven ministers: the commander (salar), the teacher (peshkar / peshgah), the balwen (?), the Barven (? messenger), the doer / expert (kardan), the maintaining of law (dastur), and the page (kodag, i.e. little one).
The seven ministers revolve within the twelve spiritual beings (ruhaniyun) - the twelve signs of the zodiac. It appears that the seven powers revolving within the twelve are the planets within the zodiac.
When the Four, the Seven and the Twelve are united in a human being, there is no longer any need for religious duties and rituals. A true religious person was the one who understood and related correctly to the principles of the universe. Apparently, he had all the fire temples closed except the three major ones.
In summary, Mazdak proposed a peace-loving, classless and egalitarian society. The doctrines of his teachings included not taking life and not eating flesh - a pacifist and vegetarian doctrine. Metaphorically, the guiding principle was to increasing the light over darkness through tolerance, justice, kindness, friendship and love (cf. Mithraic traits in Zoroastrianism). Greed and envy were seen as agents of darkness and that an insatiable desire for material goods and pleasures was a source of greed and envy. Up to this point all the ethical principles were in concert with mainstream Zoroastrianism. Where it diverged was in the application of the principles. In order to eliminate greed and envy, Mazdak proposed social reform, the giving up a quest for material wealth, and owning what property was needed in common. These principles would greatly alleviate the burdens placed on peasants and artisans and the movement quickly gained popularity amongst them. According to some sources, the spirit of sharing included sexual partners. Since this is a standard accusation against heretical sects, its veracity has been doubted by researchers. However, this could have been an interpretation amongst splinter sects.
Most authors believe Mazdakism transformed itself to Khurramdin and consequently provided the belief system for Babak Khorramdin and his supporters.