I feel like the better question would be, how does anarcho-communism prevent a state from forming? Anarcho-Capitalism has a similar problem.
My understanding of Anarcho-Communism is that workers democratically control their workplaces. There's committees galore to interact between different types of workplaces, and committees to interact with same workplaces in different areas. Committees of committees, and sometimes committees of committees of committees. Amongst all this committee and democracy... how is that not government? How is that not a state? And that's just the workplace. What do you do about the rapists and cleptomaniacs running around. That all takes leadership to deal with.
As workers (I hope you guys have jobs and life experience to know what I'm talking about,) how shit are are meetings? You're trying to get some work done, but there's a 30 minute committee meeting whether, how that's going to affect everybody's pay, etc. You would have been out of work a whole hour since you have to get to the meeting early, get situated, and the time it takes to get back into your work. But the meeting is complex and everybody has to be part of the democratic process, so the meeting goes over by 60 minutes. You've now wasted your 2 hours of your day to take part in workplace democracy. That's two hours of productivity to help yourself, your family, your coworkers... and it's gone. Your work wasn't done... because committee. As you realize that you're losing 2 and sometimes 3 hours of work a day to meetings... you conclude that your time is better spent (and better for your coworkers too) just getting work done and somebody should just stand in for you on these meetings so you can produce. And lo and behold, a management class is born. The management class of your committee attends committees with other committees who have their management class in attendance. How is that not a leadership class or government?
So you have an anarchy that's not an anarchy since it's really an oligarchy that compromises a government that's not a government.
You have the leader of the workers committee of the sandwich shop thinking, a better sandwich shop could be made, and nearer his house. But relocating is voted down. He decides to just go build one. He promises other sandwich makers in the area better wages to attract them. One of 20 doctors at the nearby hospital is sick of the stress and responsibility of having to save lives. The doctor justifiably should be compensated extra for enormous burden over the nurses and clerks. But there's 500 other workers there, and they keep democratically voting down a pay raise for the doctors at the meetings they're attending because they don't have to worry about treating patients like the doctors. The hospital isn't even making that much money, in fact everybody skipped a paycheck two months ago (by vote) because they're running out of cash. The hospital isn't making money because theres three committees of worker committees from surrounding businesses that use the hospital, but their workers all voted on prices they're willing to pay, none of which actually cover the hospital costs sufficiently, but some money is better than none even though the committee committees used to be willing to pay more (government price fixing even though there's supposedly no goverment.) Doctor realizes he can join new sandwich shop and make slightly more money than being doctor. He joins sandwich shop. It's a popular sandwich shop. There's a manager from the management class (that shouldn't exist but does) of toy store has been very effective for the workers at the toy store, helping them bring in new customers benefitting all. Store is doing extremely well. NewSandwich Shop committee realizes they could be doing better too if they have a good manager. They all vote to find a good one. Toy Manager is found by NewSandwich committee, they need him, but Toy Store needs him. Toy manager would be letting down workers if he left, plus they'd never vote to allow it (how is that not government again?) Toy manager indicates he would have to make substantially more money at NewSandwich to leave. NewSandwich committee see's the value and votes on it, approves it, and then sells it hard to Toy Manager since they really need his skills. Toy Store votes no to let Toy Manager go. Toy Manager says, meh, this is anarchy, I can do what I want and leaves. Anarcho-Capitalism is formed.
Toy Committee is pissed. They take their grievance to a committee of committee that includes Hospital Committee and Oringinal Sandwich store committee. OSandwich committee is upset because they make less money due to NewSandwich, Hospital and Toy are pissed their productive workers are pilferred. They vote that New Sandwich must close.
Anarcho Capitalist New Sandwich realizes that Luxury Soap Factory is having same issues, being ordered to close down by competitors. They form up a committee to talk to the committees and settle differences with Anarcho Communist committees. In these government on government, I mean committee on committee talks... no headway is made. Armed conflict is the only option. Freedom fighters versus oppressors.
Either way you slice it, anarcho communism leads to anarcho capitalism because the people is not the people, it's a collection of individuals with individual needs and desires, and both lead back to a formation of a government (even though they were both oligarchies at a minimum all along.)
And disputes lead to war. Nothing has changed except some doctors went underpaid and everybody pretended a management class didn't exist to keep the illusion going.