For *finite* semigroups (and thus monoids), the [Krohn–Rhodes theorem](https://en.wikipedia.org/wiki/Krohn%E2%80%93Rhodes_theory) gives a decomposition into (simple) groups and aperiodic semigroups (subsemigroup of the flip-flop).