Higher homotopy group $\pi_n(X,x_0)$ is the set of homotopy classes of maps $(S^n,p) \to (X,x_0)$ I recently learned about the higher homotopy group $\pi_n(X,x_0)$ which is defined as the set of mappings $$f:[0,1]^n \to X,\ f(\partial [0,1]^n) = x_0$$ up to homotopy. 
Given $S^n \simeq [0,1]^n/\partial [0,1]^n$ i also know that $f$ factors through a map $\overline{f}: S^n \to X$ via
$$[0,1]^n \to [0,1]^n/\partial [0,1]^n \xrightarrow{\overline{f}} X$$
Therefore any element $[f] \in \pi_n(X,x_0)$ corresponds to a homotopy class of maps $(S^n,p) \to (X,x_0)$.
My question is: What exactly causes (in algebraic terms) the correspondence between $[0,1]^n\to X$ and $S^n \to X$?
My guess: I am assuming, that due to the universal property of the quotient groups quotient topology the given map $\overline{f}$ is isomorphic to $f$ $[0,1]^n$ and $S^n$ correspond (up to isomorphism) to each other and it follows from that observation that $f$ corresponds to $\overline f$ (up to isomorphism).  But i was not entirely sure if that's the case.
Is my assumption correct or am i missing something? I am working with Hatcher (p. 340) and he only states that "we can also view $\pi_n(X,x_0)$ as homotopy classes of maps $(S^n,s_0) \to (X,x_0)$ but I'd love to know the algebraic reasoning behind his statement.
Thanks for any help.
 A: I'll give a conceptual sketch for the "big picture" reason why these definitions are the same, which has very minimal algebraic input. The idea is that if $n \geq 1$ then $\pi_n(X) \cong \pi_0 (F(X))$ where $F(X)$ is a space of functions with a "composition law", which can be equivalently described in terms of either $I^n$ or $S^n$. Like Tyrone mentions in their comment, the equivalence of these descriptions is primarily due to the universal property of the quotient space. 
I think if you're really looking for an "algebraic" reason why these two descriptions of $\pi_n(X)$ are equivalent, I would say it's because the two descriptions of $F(X)$ are isomorphic as $H$-spaces.

If we let $C(Y, X)$ denote the space of continuous functions from $Y$ to $X$ with the compact-open topology, then consider the following two spaces
$$C_\bullet(I^n, X) = \{ f \in C(I^n, X) \mid f(\partial I^n) = x_0 \} $$
$$C_\bullet(S^n, X) = \{ f \in C(S^n, X) \mid f(e_1) = x_0 \} $$
where $x_0$ is the basepoint of $X$, and the first standard basis vector $e_1 \in\mathbb{R}^{n+1}$ is the basepoint of $S^n$. Note that both of these function spaces are naturally pointed, where the basepoint is the constant function. (You might find these definitions familiar: the space $C_\bullet(I^n, X)$ is often called the "based $n$-fold loop space of $X$" and is typically denoted $\Omega^n X$.)

Claim: The quotient map $I^n \to I^n/\partial I^n \cong S^n$ induces a homeomorphism $$\Phi \colon C_\bullet(I^n, X) \cong C_\bullet(S^n, X)$$
  for any $X$.

To define $\Phi$ and see it is a bijection you just use the universal property of the quotient space, but to show continuity in both directions you need to use the compact-open topology.
However, for homotopy groups we're concerned with homotopy classes of such maps. Because of the topology on the function spaces this is actually the same as taking path components: in fact the set $\pi_0 (C_\bullet(I^n, X))$ is by definition $\pi_n(X)$ as you've defined it. But since $\Phi$ is a homeomorphism in particular it induces a bijection 
$$ \Phi_* \colon \pi_0C_\bullet(I^n, X) \cong \pi_0 C_\bullet(S^n, X). $$
As long as $n>0$ both of the function spaces have standard composition laws that are used to define the $n$-th homotopy group, say $\mu_I$ and $\mu_S$. These composition laws are not strictly group operations (in fact they are $H$-spaces) but they do induce group operations on $\pi_0$. If you are careful about how you choose these composition laws you can have $\Phi\circ \mu_I(f, g) = \mu_S (\Phi(f), \Phi(g))$ on the nose (so that it's actually an isomorphism of $H$-spaces), so in particular the bijection $\Phi_*$ is also a group homomorphism and hence an isomorphism. 

Tying it all together, if we denote by $\pi_n'(X)$ the $n$-th homotopy group defined using $S^n$ rather than $I^n$, then we have 
$$\pi_n(X) \cong \pi_0 C_\bullet(I^n, X) \stackrel{\Phi_*}{\cong} \pi_0C_\bullet(S^n, X) \cong \pi_n'(X). $$
