IMO, communism, as I understand it, actually doesn't, yet achieving it through socialism (as USSR tried) is not the way, instead going the collectivist anarchism route and straight up ditching the vertical power structures is better.
Like when you keep states, they start protecting themselves/oppressing othets and turn into a class of their own, thus eliminating the possibility of them self-disdolving when the society becomes classless.
Although it's not that I've read a whole lot on the topic, so it may be much more complicated than that