Why does $(a + b)^3$ expand to $a^3 + 3ab^2 + 3a^2b + b^3$ 
Why does $(a + b)^3$ expand to $a^3 + 3ab^2 + 3a^2b + b^3$

Why does this work? I am confused as to why this happens. 
 A: In overly pedantic detail:
\begin{align}
(a+b)^3
 &= (a+b)[(a+b)(a+b)] \tag{by definition} \\
 &= (a+b)[a(a+b) + b(a+b)] \tag{distribution} \\
 &= (a+b)[a^2 + ab + ba + b^2] \tag{distribution} \\
 &= (a+b)[a^2 + 2ab + b^2] \tag{commutativity} \\
 &= a[a^2 + 2ab + b^2] + b[a^2 + 2ab + b^2] \tag{distribution} \\
 &= a^3 + a2ab + ab^2 + ba^2 + b2ab + b^3 \tag{distribution} \\
 &= a^3 + 2a^2b + ab^2 + a^2b + 2ab^2 + b^3 \tag{commutativity} \\
 &= a^3 + 3a^2b + 3ab^2 + b^3. \tag{collect like terms}
\end{align}
A: Since pictures don't appear in the comments well,

A: Let's break the algebra down, one step at a time. Trying to use colors to keep track of what comes from what.
You have that $$(a+b)^3 = \color{green}{(a+b)^2}\cdot (\color{#AA33FF}{a}+\color{#11AAFF}{b})$$
I assume you know $(a+b)^2 = a^2+2ab+b^2$, from which
$$
(a+b)^3 = \color{green}{(a^2+2ab+b^2)}\cdot (\color{#AA33FF}{a}+\color{#11AAFF}{b})
$$
Now, distributing (i.e., $c(a+b)=ca+cb$),
$$
(a+b)^3 = \color{green}{(a^2+2ab+b^2)}\cdot \color{#AA33FF}{a}+\color{green}{(a^2+2ab+b^2)}\cdot \color{#11AAFF}{b}
$$
Distributing again,
$$
(a+b)^3 = a^2\cdot \color{#AA33FF}{a}+2ab\cdot \color{#AA33FF}{a}+b^2\cdot \color{#AA33FF}{a} + a^2\cdot \color{#11AAFF}{b}+2ab\cdot \color{#11AAFF}{b}+b^2\cdot \color{#11AAFF}{b}
$$
that is
$$
(a+b)^3 = a^3+\color{red}{ 2a^2b}+\color{blue}{ a b^2} + \color{red} {a^2b}+\color{blue}{ 2ab^2}+b^3
$$
and regrouping the blue and red terms together,
$$
(a+b)^3 = a^3+\color{red}{3a^2b}+\color{blue}{3ab^2}+b^3
$$
giving the result.
A: Algebra meets combinatorics.  The exponent $3$ tells us to expand the product of three binomials
\begin{align*}
(a+b)^3=(a+b)(a+b)(a+b)
\end{align*}
From each of the three factors $a+b$ we have to select either $a$ or $b$.

Let's list the different possibilities:
  
  
*
  
*From each    binomial   we select an  $a$. Since there is only one way to do so we obtain
  \begin{align*}
aaa\qquad\rightarrow\qquad \color{blue}{1a^3}\qquad\qquad\ \ 
\end{align*}
  
*Number of ways to select two  $a$'s and  one $b$
  \begin{align*}
aab,\ aba,\ baa\qquad\rightarrow\qquad aab+aba+baa=\color{blue}{3a^2b}
\end{align*}
  
*Number of ways to select two  $b$'s and  one $a$
  \begin{align*}
bba,\ bab,\ abb\qquad\rightarrow\qquad bba+bab+abb=\color{blue}{3ab^2}
\end{align*}
  
*Number of ways to select three  $b$'s
  \begin{align*}
bbb\qquad\rightarrow\qquad \color{blue}{1b^3}\qquad\qquad\ \ 
\end{align*}
  
*No  other possibilities.
  
  
  We conclude
  \begin{align*}
(a+b)^3=a^3+3a^2b+3ab^2+b^3
\end{align*}

Hint:  Observe the nice symmetry between $a$ and $b$.
Challenge: Try a similar approach with $(a+b)^\color{blue}{4}$ and verify the result algebraically. This is more complex but still feasible .
A: If you want something step by step use the distributive property and associative property: 
$$
\begin{array}{rll}
(a+b)^{3}=
& 
\underbrace{(\color{red}{a}+\color{red}{b})}_{=x}
\cdot
\underbrace{(\color{green}{a}+\color{green}{b})}_{=y}
\cdot 
(\color{blue}{a}+\color{blue}{b})
&\\
=&\underbrace{\color{red}{x}
\cdot 
\color{green}{y}}_{=z}
\cdot 
(\color{blue}{a}+\color{blue}{b})
&\\
=&
z\cdot (\color{blue}{a}+\color{blue}{b})
&\\
=&
z\cdot \color{blue}{a}+z\cdot\color{blue}{b}
&
\mbox{distributive property}
\\
=&
(x\cdot y)\cdot \color{blue}{a}+(x\cdot y)\cdot\color{blue}{b}
&
z=(x\cdot y)
\\
=&
x\cdot (y\cdot \color{blue}{a})+x\cdot (y\cdot\color{blue}{b})
&
\mbox{associative property} 
\\
=&
x\cdot \big((\color{green}{a}+\color{green}{b})\cdot \color{blue}{a}\big)
+
x\cdot \big((\color{green}{a}+\color{green}{b})\cdot\color{blue}{b}\big)
&
y=\color{green}{a}+\color{green}{b}
\\
=&
\underbrace{x\cdot \big(\color{green}{a}\color{blue}{a}+\color{green}{b}\color{blue}{a}\big)}_{}
+
\underbrace{x\cdot \big(\color{green}{a}\color{blue}{b}+\color{green}{b}\color{blue}{b}\big)}_{}
&
\mbox{distributive property}
\\
=&
x\cdot(\color{green}{a}\color{blue}{a})+x\cdot(\color{green}{b}\color{blue}{a})
+
x\cdot(\color{green}{a}\color{blue}{b})+x\cdot(\color{green}{b}\color{blue}{b})
&
\mbox{distributive property}
\\
=& x\color{green}{a}\color{blue}{a}\;+
\\
&\hspace{6mm} + 2x\color{green}{a}\color{blue}{b}\;+
\\
&\hspace{18mm} + x\color{green}{b}\color{blue}{b}
\\
=& (\color{red}{a}+\color{red}{b})\color{green}{a}\color{blue}{a}\;+
\\
&\hspace{5mm} + 2(\color{red}{a}+\color{red}{b})\color{green}{a}\color{blue}{b}\;+
\\
&\hspace{15mm} + (\color{red}{a}+\color{red}{b})\color{green}{b}\color{blue}{b}
\\
=& \color{red}{a}\color{green}{a}\color{blue}{a}+\color{red}{b}\color{green}{a}\color{blue}{a}\;+
&\mbox{distributive property}\\
&\hspace{5mm} + 2(\color{red}{a}\color{green}{a}\color{blue}{b}+\color{red}{b}\color{green}{a}\color{blue}{b})\;+
& \mbox{distributive property}\\
&\hspace{15mm} + \color{red}{a}\color{green}{b}\color{blue}{b}+\color{red}{b}\color{green}{b}\color{blue}{b}
&\mbox{distributive property}
\\
=& \color{red}{a}\color{green}{a}\color{blue}{a}+\color{red}{b}\color{green}{a}\color{blue}{a}\;+
&\\
&\hspace{8mm} + 2\color{red}{a}\color{green}{a}\color{blue}{b}+2\color{red}{b}\color{green}{a}\color{blue}{b}\;+
& \mbox{distributive property}\\
&\hspace{21mm} + \color{red}{a}\color{green}{b}\color{blue}{b}+\color{red}{b}\color{green}{b}\color{blue}{b}
\\
=& 
a^3+a^2b+
&\\
&\hspace{8mm} + 2{a}^2{b}+2{a}{b}^2\;+
& \\
&\hspace{21mm} + {a}{b}^2+{b}^3
\\
=& a^3+3a^2b+3ab^2+b^3
\end{array}
$$
