The class equation is really a special case of the fact that if $G$ acts (not necessarily transitively) on a set $\Omega,$ then $|\Omega|$ is the sum of the size of the orbits. In the class equation, $G$ acts on itself by conjugation, the orbits are the conjugacy classes, and the size of the conjugacy class of $x$ is $[G:C_{G}(x)].$ The euation as you have written it is often known as the modified class equation. In that, all the conjugacy classes of size $1$ have been collected together, since the element $x$ is in a conjugacy class of size $1$ if and only if $x \in Z(G).$ There is a connection in as much as when a finite group $G$ acts transitively on a set $\Omega,$ then all point stabilizers have the same size$|G_{\alpha}|$ for any $\alpha \in \Omega$ so we have $|\Omega| = [G:G_{\alpha}].$ Thus $\sum_{ \alpha \in \Omega }|G_{\alpha}| = |G|.$ But that sum is the number of order pairs $(\alpha, g) \in \Omega \times G$ such that $\alpha.g = \alpha.$ If we sum this over $g \in G$ first, it's the same as $\sum_{g \in G} \# (\alpha \in \Omega : \alpha.g = \alpha).$