The medieval serf was a slave by another name. Serfs were the laborers and farm machinery that kept the economy of medieval Europe moving. A serf was free in name but in fact his feudal lord controlled most aspects of his life. The lord of the manor dictated how many days a week work he required, what that work was and even in some cases who the serf married. A serf was not allowed to leave the manor except with his lord's permission. The owner of the land, the feudal lord, allowed a serf to farm a piece of land in return for duties performed.
This in itself does not sound so bad, except that these duties often amounted to a full time job. The opportunities for self-improvement were limited but a serf could farm his land as he saw fit. Any profits he made from selling excess produce were his to keep, and his heirs could inherit his land and property. The serf was not free to leave his land and lord, but at the same time the lord of the manor was not free to dispossess the serf without due cause. If the serfs land failed, then he was at the mercy of the lord of the manor and he and his family could starve, but in fact the lord of the manor was expected to pay some degree of attention to his serfs and look to their welfare. In times of unrest the lord of the manor would be expected to protect his serfs.
The condition of serfdom was hereditary, if you were born the child of a serf, then you too were a serf. People also became serfs "voluntarily" as a means of escaping debt, or were made into serfs to pay debts. This condition may have had a time limit on it, or more often the entire family immediately became serfs along with the debtor.
Serfdom began to disappear in the late middle ages, particularly in Western Europe. The main reason for this was economic. The ravages of the plague killed many serfs and peasants, and their services became more valuable, allowing them more bargaining power. The centralization of the population in towns and the growth of early industry both contributed to the demise of the feudal system. Before these developments a serf without land would die of starvation. With the growth of towns and a non-agrarian economy the population had to chance to survive without land to farm of their own.
Before this one of the only ways a serf could obtain freedom was to buy himself. He could literally buy freedom from his lord of the manor. This prospect appealed to many of the lords, once the serf became a peasant he then had to pay rent for his land, and taxes to his lord of the manor. Attracting the attention of the feudal lord to the fact that you had saved that much money was in itself risky however. Accusations of dishonesty could be made, or taxes imposed so that the lord acquired your money, without you acquiring your freedom.
The lord of the manor could also make serfs into free men. This could occur as a reward for good service, or a punishment for bad. The life of a medieval peasant may have technically been better than that of a serf but in many ways it could actually be harder. A skilled peasant such as a miller or carpenter could make a good living but a farming peasant was totally reliant on his land.