There are some Hadeeths narrated that mention the reasons for fasting on ‘Aashooraa’ and they are apparently contradictory. Some narrations, for instance, signify that Muslims observed fasting on this day in Makkah before Hijrah and that the Quraysh used to also fast on it. They also used to garment the Ka‘bah on this day, as narrated by Al-Bukhari and others. There are other Hadeeths which signify that fasting on this day was ordained after Hijrah when the Prophet found the Jews venerating this day on which Allah saved Moosa (Moses), may Allah exalt his mention, from Pharaoh. How can we reconcile between the versions?
All perfect praise be to Allah, the Lord of the Worlds. I testify that there is none worthy of worship except Allah, and that Muhammad is His Slave and Messenger.
It was narrated on the authority of Ibn ‘Abbaas, may Allah be pleased with him, “The Prophet arrived in Madeenah and saw the Jews fasting on the day of ‘Aashooraa’ (10th of Muharram). He asked them about this. They replied, ‘This is a good day; the day on which Allah rescued the children of Israel from their enemy. So, Moosa fasted this day.’ The Prophet said: ‘I have more claim over Moosa than you.’ So, the Prophet fasted on that day and ordered (the Muslims) to fast on it too.” [Al-Bukhari and Muslim]
It was narrated on the authority of ‘Aa’ishah, may Allah be pleased with her, that she said, "Quraysh would fast on the day of ‘Aashooraa’ in the pre-Islamic period, and the Messenger of Allah too, would fast on that day. When he migrated to Madeenah, he fasted on that day and ordered Muslims to fast on it too." [Al-Bukhari and Muslim]
There is no contradiction between this Hadeeth and the previous one, and the reason is that the Jews' saying did not create a new ruling, but it was rather simply just a description of the state of affairs and an answer to a question.
Ibn Hajar said,
The Hadeeth does not contradict the Hadeeth of ‘Aa’ishah since it is possible that both the Jews and the Quraysh used to fast on it at the same time for different reasons. Al-Qurtubi said, "Perhaps Quraysh fasted on this day based on following a previous divine law, such as that which was revealed to Ibraaheem (Abraham), may Allah exalt his mention. The fasting of the Prophet might have been by virtue of him agreeing with them as happened in Hajj, or because Allah The Almighty permitted him to fast on it as a good deed. Later, when he migrated, he found the Jews fasting on it and asked them why they were fasting on it. So, the fact that he fasted on it and ordered Muslims to fast on it too might have been done in order to attract the hearts of the Jews just as he did by facing their Qiblah. In any case, the Prophet did not fast on ‘Aashooraa’ to imitate them; rather, he used to fast on it before knowing that they did so.
Allah Knows best.