In ancient times the Romans built an empire off the backs of thousands of slaves. In colonial times, slaves made up a huge portion of the new world's population and they were a key part of the colonial economy. During the middle ages however, it seems to me that peasants constituted the bottom of the social pyramid. Is this the case? If so why did slavery go from being widespread to absent to widespread again? Could it stem from religious or social changes?
"The peasantry" - assuming we're referring to the rural population chiefly employed in the agrarian economy - is a vast hierarchy of many different social classes. In the context of early medieval England, I wrote an answer about the different tiers of peasantry in the Early Medieval period here and went into more detail about the rough areas of land they would have held depending on their status here. In that first answer, you'll see I reference slaves. At the time of Domesday (1086), one in ten of the 'households" listed in the Domesday Book are slaves. Depending on whether a slave "household" constituted a single slave or the approximately 4-5 people inferred by a normal "household", slaves constituted anywhere from 2.5% - 10% of the population, and this was after a period of decline. Slavery had long been a part of Anglo-Saxon society; slaves were typically Welsh, or, from the tenth century onwards, Irish, imported from Hiberno-Norse settlements on the east coast of Ireland via the ports of Bristol and Chester, but not exclusively. Penal slavery also occurs in a number of English law codes dating back to the seventh century, and was periodically a punishment for a variety of offences including housebreaking and working on a Sunday. Throughout the period there is a growing corpus of laws around the responsibilities of slave owners, rights and protections for slaves, and changing opinions on the selling of English penal slaves overseas, rules around manumission, and a significant corpus of wills which either bequeath or free slaves.
/u/Steelcan909 most recently wrote an excellent answer about slavery in England here.