It is tricky to do this in a way that allows for complex coordination at scale while avoiding the oppressive properties of systems which we would all recognize as undesirable. The concept that is required in order to properly navigate this is 'coercive control'.
Hierarchy happens when some people are 'above' others, or, in other words, can make decisions for other people and enforce them without their consent. This is coercive control. This is the situation that we want to avoid.
At the same time, the collective does have to be able to enforce rules, so some degree of coercion must be allowed in order to avoid a sort of paradox-of-tolerance situation. To resolve this apparent contradiction, we introduce the notion of a 'social contract'. To be a part of an anarchist organization would require that a person agree to a social contract. As long as the person upholds the social contract, they cannot otherwise be coerced, as that would be a violation of anarchist principles, and could result in oppressive behavior. (Note: For this to be self-consistent, coercion has to be outlawed as part of said social contract.) If a person breaks the social contract, then they are also no longer protected by it, and can be coerced by the group to leave or such.
The social contract bit is sort of an aside to the original question, but I think people get confused by what is and isn't hierarchy because they understand the first part in some way, even if they don't have the words for it, but then they don't know how to solve the obvious problem of enforcing rules so that people's freedoms can actually be protected in practice.
Centralization doesn't necessarily imply hierarchy, as, given an undirected acyclic graph, you can pick any node to be the 'root' and end up with a valid 'tree' - the structure that most people would visualize when they hear the word 'hierarchy'. Of course, we would prefer to not pick any node as the root, as the hierarchical structure implied by such a distinction shouldn't be necessary for the collective to reap the benefits of such centralization. There is a whole discussion that could be had about how to actually implement centralization without falling into various traps, but that isn't really what the question in the OP is about. I simply bring it up because some people confuse centralization for hierarchy, and end up shooting themselves in the foot for doing so.
I intended for this to basically be the definition, but I can try to rephrase to make it clearer.
'Hierarchy' is any social structure or relationship where someone has coercive power over another person, and where that coercive power is a normalized part of the structure or relationship. This normalization could be a social contract or the result of patterns of abusive behavior, it doesn't really matter exactly how it happens. It's just important to distinguish between coercion that happens because someone is breaking the rules and coercion that happens even when nobody is breaking any rules. It is the latter that forms a power dynamic between individuals or groups, and it is these power dynamics that hierarchies are made of.
I hope that clears things up.