Why can we re-express the sum of group elements $g\in G$ to the sum of elements of $s\in S$ in Burnside's Lemma? Question:
In the proof of Burnside's Lemma, after assuming there are $r$ orbits, we can show that
$$ \frac{1}{|G|}\sum_{g\in G} = \frac{1}{|G|}\sum_{g\in G}\sum_{i=1}^r |S_i^g| = \sum_{i=1}^r \frac{1}{|G|}\sum_{g\in G}|S_i^g|. $$
We then wish to show that $\frac{1}{|G|}\sum_{g\in G}|S_i^g| = 1$ for each $i$ and so,
\begin{align*} \frac{1}{|G|}\sum_{g\in G} |S^g| &= \frac{1}{|G|}\sum_{g\in G}|\{s\in S:g.s = s\}| \\ &= \frac{1}{|G|}|\{(g,s)\in G\times S:g.s=s\}| \\ &= \frac{1}{|G|}\sum_{s\in S} |\{g\in G:g.s = s\}| \\ &= \frac{1}{|G|}\sum_{s\in S} |\mathrm{stab}_G(s)|. \end{align*}
However I can't seem to convince myself of the step: $$ \boxed{\frac{1}{|G|}\sum_{g\in G}|\{s\in S:g.s = s\}| = \frac{1}{|G|}|\{(g,s)\in G\times S:g.s=s\}| = \frac{1}{|G|}\sum_{s\in S} |\{g\in G:g.s = s\}| .}$$ Why can we do this? How does a sum over $g\in G$ become equivalent to counting all pairs and then become a sum over $s\in S$? Does this imply that the cardinality of the stabiliser and the fixed point set is always the same? This seems like some very slight notation trickery that I just can't intuitively see.
Any illumination would be greatly appreicated. Thank you.
As a side note, I hope my question has been worded adequately, as there is a lot of context which would have been difficult to leave out.
 A: I think that the thing that is happening is very similar to what happens in the following scenario.
Let $G$ be a bipartite part with sides $X,Y$ where $X=\{x_1,\dots,x_{n_1}\}$ and $Y=\{y_1,\dots,y_{n_2}\}$. Then the number of edges of $G$ can be obtained with the following expressions:
$m= \sum\limits_{i=1}^{n_1} d(x_i)$.
$m= \sum\limits_{i=1}^{n_2} d(y_i)$.
They are basically doing this step twice, to get:
$\sum\limits_{i=1}^{n_1} d(x_i)=m= \sum\limits_{i=1}^{n_2} d(y_i)$
In fact we can turn your problem into the previous setting by letting $X=G$ and $Y=S$, and making the edges the pairs $\{x,s\}$ with $x.s=s$
A: In general:
\begin{alignat}{1}
\lbrace \operatorname{stab}_G(s) \times \lbrace s \rbrace, s \in S \rbrace &= \{\{g\in G\mid g\cdot s=s\}\times\{s\},s\in S\}\\
&= \lbrace (g,s) \in G \times S \mid g\cdot s=s \rbrace \\
&= \lbrace \lbrace g \rbrace \times \{s\in S\mid g\cdot s =s\}, g \in G \rbrace \\
&= \lbrace \lbrace g \rbrace \times S^g, g \in G \rbrace \\
\tag 1
\end{alignat}
If both $G$ and $S$ are finite, then from $(1)$ follows:
\begin{alignat}{1}
\sum_{s\in S}|\operatorname{stab}_G(s)| &= |\lbrace \operatorname{stab}_G(s) \times \lbrace s \rbrace, s \in S \rbrace| \\
&= |\lbrace \lbrace g \rbrace \times S^g, g \in G \rbrace| \\
&= \sum_{g\in G}|S^g|
\end{alignat}
