Sunni IslamDuring the time of the Prophet Muhammad, local Jews observed a day of fasting at this time -- their Day of Atonement. The Prophet Muhammad learned of of this tradition, and stated that the Muslims should also fast. He himself fasted for 2 days, and recommended that others do so as well. This fast is not required, simply recommended.
Shi'a IslamAfter the death of the Prophet Muhammad, a schism developed within the community about who was to succeed him in leadership of the Muslim nation. This was the beginning of the historical split between Sunni and Shi'a Muslims (see the article "What's the Difference Between Shi'a and Sunni Muslims?" for more details).
In the year 680 A.D., an event happened that was a turning point for what was to become the Shi'a Muslim community. Hussein, the grandson of the Prophet Muhammad, was brutally murdered during a battle against the ruling Caliph -- on the 10th day of Muharram ('Ashura). This took place in Karbala (modern-day Iraq), which is now an important pilgrimage site for Shi'a Muslims.
Shi'a Muslims observe the day in mourning for Hussein and in remembrance of his martyrdom. Reenactments and plays are performed, attempting to relive the tragedy and keep the lessons of this event alive. Some Shi'a Muslims beat and flog themselves in parades on this day, to express their grief and to reenact the pain that Hussein suffered.