The day of Ashura was a day that the Messenger of Allah ﷺ used to fast during the pre-Islamic era, and Quraysh also used to fast it during that time. When the Prophet ﷺ arrived in Medina, he fasted it and ordered others to fast it. Then, when Ramadan was prescribed, Ramadan became the obligatory fast, and Ashura was left as optional.
حدثنا يحيى بن زكريا حدثنا هشام بن عروة عن أبيه
كان يوم عاشوراء يوما يصومه رسول الله ﷺ في الجاهلية وكانت قريش تصومه في الجاهلية فلما قدم النبي ﷺ المدينة صامه وأمر بصيامه فلما نزل رمضان كان رمضان هو الفريضة وترك عاشوراء