There are specific 'counters' like pikes, fortifications etc, but they only trade effectively against head on charges. Cavalry still held the advantage of tactical mobility, which meant they dominated reconnaissance, can pursue and annihilate defeated enemies, can retreat gracefully etc.
There may be no counters to drones except for more drones. Or the counter may have to be highly strategical, such as devastating hack-based attacks that may involve use of advanced and dangerous AIs (Cyberpunk Blackwall...).
Artilleries also had no counter for like 50 years. And completely reshaped military doctrine and strategy, made WW1 into a slog etc. WWII found a way to 'beat' artillery by armored thrusts to get behind them, but that is not easily achievable.