'Ashura' commemorates the day that Allah saved the Children of Israel from Pharaoh.
Fasting on Muharram 10, known as the Day of 'Ashura', expiates for the sins of the past year. When the Prophet (peace and blessings be upon him) arrived in Madinah in 622 CE, he found that the Jews there fasted on Muharram 10 and asked them the reason for their fasting on this day. They said," This is a blessed day. On this day Allah saved the Children of Israel from their enemy (in Egypt) and so Prophet Musa [Moses] fasted on this day giving thanks to Allah."
The Prophet (peace and blessings be upon him) said,
"We are closer to Musa than you are."
He fasted on that day and commanded Muslims to fast on this day. (Al-Bukhari) The following year, Allah commanded the Muslims to fast the month of Ramadan, and the fasting of 'Ashura' became optional. It is also reported that the Prophet (peace and blessings be upon him) intended to fast on the ninth and tenth. Ibn 'Abbas reported: The Messenger of Allah fasted on the day of 'Ashura' and ordered the people to fast on it. The people said, "O Messenger of Allah, it is a day that the Jews and Christians honor." The Prophet said, "When the following year comes, Allah willing, we shall fast on the ninth." The death of the Prophet came before the following year. (Muslim and Abu Dawud)