Before I formulate my question, I give two examples to motivate it:
i) Given a group homomorphism $\varphi : G \to H$ betwenn finite groups the kernel $N := \mbox{ker}(\varphi) = \{ g \in G : \varphi(g) = 1 \}$ is a normal subgroup, and by Lagrange we have $|G| = [G : N]\cdot |N|$, hence $$ \left| G / N \right| = |G| / |N| $$ i.e. we can make precise statements about the cardinality of the quotient structure (the factor group).
ii) Going more general, if we consider maps $f : A \to B$ between finite sets, the kernel of the map is defined to be $\mbox{ker}(f) = \{ (a,b) : f(a) = f(b) \}$ and the quotient structure is the set of equivalence classes. This time there is no easy connection between the number of equivalence classes and the size of $A$, as anything can happen as each partition corresponds to a map and thereby equivalence classes.
Now the general case, if I restrict myself on morphisms $f : A \to B$ such that each equivalence class has the same cardinality, then something like a "Lagrange formula" holds, i.e. $$ \left| A / \mbox{ker}(f) \right| \cdot k = |A| $$ where $k$ denotes the common size of the equivalence classes. Now I want to look at algebraic structures for which we have quotient structures and the equivalence classes all have the same size, i.e. we have a "Lagrange formula" like in the group case.
To be more concrete, let $S$ and $T$ be two sets with a concatenation operation and let them have the property that for each morphism $\varphi : S \to T$ (i.e. maps that respect the concatenation) the equivalence classes under this map have the same size. Therefore we have something like a Lagrange formula for them. Is there anything known about such structures? Could this condition be expressed in terms of a law (or several) for the concatenation operation? (like when $S$ and $T$ are groups then we have such a connection, but I do not think that groups are the only such structures).
Remark: The kernel as defined for groups and the kernel for bijections are related, we have $\varphi(g) = \varphi(h)$ iff $\varphi(gh^{-1}) = 1$, and thereby two element are equivalent when they are in the same coset. More specifically the kernel in the group case is the equivalence class of the neutral element, and each other equivalence class is a translation of this one (the cosets). Maybe the kernel is redefined in the group case to have such a nice notation like $G/N$ for factor groups. Also Lagrange formula also holds for arbitrary subgroups, hinting that in the group case much relations work together to give these connections between quotient structures and cardinalities, and thereby I would expect a much weaker set of laws would also yield this relation.