Combat is a common practice in Mount and Blade II: Bannerlords. Most of the time, you and your army will start a campaign with a horse at your disposal, making it much easier to travel between destinations. During the fight you might want to fight on horseback, but if you also want to change your strategy and try to descend, fight your enemies with both feet.
You have the option to choose whether you want to get on or off your horse during the fight. All you have to do is watch your horse and hold the "F" button to dismount. You can also choose to press the "Z" button to dismantle it, but you will need to press the "F" KEY if you wish to reassemble your horse. You will not have the option to return or dismount your horse during combat when enemies are nearby. You don't want to attempt to get off your horse during the fight, as you'll have to come to a complete stop to get there. You'd better make the decision early before the troops rush after you.
All commanders have the option of making the same decision with their army. If you want your troops to get off their horses, you have to press the F5 key. They will disembark, and they will stand by their horses, ready for battle, and continue to await your orders. When you want to re-ride their horses, all you have to do is press the F5 key again, and they'll start riding their mounts again.
Choosing the best time for you and your troops to fight on horseback is essential. If your opponents are also fighting in combat, chances are you want to stay on your horse to level the playing field. The same is true if they don't have mounted fighters, which gives you a distinct advantage during battle. The choice is yours, and the weapons you have and your army can determine which is the best choice, as well as what skills or perks you have.