The Byzantine Empire continued to have professional infantry, because they were still wealthy enough and capable enough to support a standing army. They also had horse archers, which had been a key component of the army in the late Western Roman Empire but had almost disappeared in the West afterwards. And before their decline, their heavy cavalry also consisted of professional soldiers instead of individual warriors.
Professional infantry reappeared in the West in the late middle ages in the form of mercenaries. Then it turned out that pikemen were generally more effective than knights. While a charging horse is big and scary, it's not actually large enough to crash through infantry lines. If the infantry doesn't chicken out, the charging knight has to.