[proofplan]
The event $\{S_n=k\}$ is the disjoint union of outcomes where exactly $k$ of the Bernoulli variables equal $1$. Each such pattern has probability $p^k(1-p)^{n-k}$ by independence, and there are $\binom nk$ patterns.
[/proofplan]
[step:Decompose by success sets]
For $I\subset\{1,\ldots,n\}$ with $|I|=k$, let
\begin{align*}
E_I=\bigcap_{i\in I}\{X_i=1\}\cap\bigcap_{i\notin I}\{X_i=0\}.
\end{align*}
The events $E_I$ with $|I|=k$ are pairwise disjoint, and their union is $\{S_n=k\}$.
[/step]
[step:Compute each pattern]
By independence and the Bernoulli law,
\begin{align*}
\mathbb P(E_I)=\prod_{i\in I}\mathbb P(X_i=1)\prod_{i\notin I}\mathbb P(X_i=0)
=p^k(1-p)^{n-k}.
\end{align*}
There are $\binom nk$ subsets $I\subset\{1,\ldots,n\}$ of size $k$. Therefore
\begin{align*}
\mathbb P(S_n=k)=\sum_{|I|=k}\mathbb P(E_I)=\binom nk p^k(1-p)^{n-k}.
\end{align*}
[/step]