In short:
Russia has become the first country to formally recognise the Taliban’s government in Afghanistan since it seized power in 2021.
Afghanistan’s Foreign Ministry called Russia’s official recognition a historic step.
The Taliban has sought international recognition while also enforcing its strict interpretation of Islamic law.
I agree with your conclusion (recognition should be based entirely on who has Actual Control, in cases where that can be clearly determined), but not with this particular explanation. Nobody “recognises” Taiwan, but it has nothing to do with believing it’s illegitimate or unrepresentative. It has to do with the fact that China has a hissy fit if you do.