Cavalry on Earth had never retired from the historical stage just because of the invention of muskets; on the contrary, they were predominantly the main force of armies and most often had overwhelming combat power over musket squads.
Many people mistakenly believed that it was the gradual improvement of muskets that led cavalry to exit the war stage, but in fact, this statement is not correct.
Both cavalry charges and dense infantry charges were tactics of line-of-sight warfare, and muskets were also products of the later stages of line-of-sight warfare. Therefore, the appearance of muskets did not cause revolutionary changes to traditional military tactics.
What truly changed the form of line-of-sight warfare were rapid-fire weapons, with iconic ones being the Maxim machine gun and the Gatling gun.