Back to game concepts
Anarchy happens when you unlock a policy tree that is incompatible with another policy tree you have already unlocked. Piety and Rationalism, for instance, are incompatible. As a result of this change, the old policy tree will be rendered inactive, though you may activate it again (and thus re-enter anarchy) at any time at no Culture cost.
In Brave New World there are no more mutually exclusive Social branches, and Anarchy happens instead when you're forced to change Ideologies, with the same effect.
Though you generally want to avoid anarchy, it can sometimes be worthwhile if your priorities have changed or as part of a special strategy.