Consider an excerpt of a lemma and part of its proof from a Riemannian geometry textbook.
Lemma. The second fundamental form is
- independent of the extensions of $X$ and $Y$;
- bilinear over $C^\infty(M)$; and
- symmetric in $X$ and $Y$.
Proof. First we show that the symmetry of $\Pi$ follows from the symmetry of the connection $\tilde{\nabla}$. Let $X$ and $Y$ be extended arbitrarily to $M$. Then$$\Pi(X, Y) - \Pi(Y, X) = (\tilde{\nabla}_X Y - \tilde{\nabla}_Y X)^\perp = [X, Y]^\perp.$$Since $X$ and $Y$ are tangent to $M$ at all points of $M$, so is their Lie bracket. Therefore $[X, Y]^\perp = 0$, so $\Pi$ is symmetric.
One thing I do not really understand is the following statement.
Since $X$ and $Y$ are tangent to $M$ at all points of $M$, so is their Lie bracket.
Why is this statement true?
I believe you are considering the case where $M$ is an embedded submanifold of $N$ and $X, Y \in \Gamma(M, TM) \subset \Gamma(M, TN|_M)$.
Suppose $\operatorname{dim}M = m$ and $\operatorname{dim}N = n$. Let $(U, (x^1, \dots, x^n))$ be slice coordinates on $N$ for $M$, i.e. coordinates such that $U\cap M = \{p \in U \mid x^{m+1}(p) = \dots = x^n(p) = 0\}$. If $\{\partial_1, \dots, \partial_n\}$ denotes the corresponding frame for $TN|_U$, then $\{\partial_1, \dots, \partial_m\}$ is a frame for $TM|_U$. So for every $p \in U$, $\operatorname{span}\{\partial_1|_p, \dots, \partial_m|_p\} = T_pM$.
Now let $X, Y \in \Gamma(M, TM)$. Then $X|_U = \sum_{i=1}^mX^i\partial_i$ and $Y|_U = \sum_{j=1}^mY^j\partial_j$ for some smooth functions $X_1, \dots, X_m, Y_1, \dots, Y_m$ on $U$. So
\begin{align*} [X, Y]|_p &= [X|_U, Y|_U]|_p\\ &= \sum_{i,j=1}^m((X^i\partial_iY^j)\partial_j - (Y^j\partial_jX^i)\partial_i))|_p\\ &= \sum_{i,j=1}^m(X^i\partial_iY^j)(p)\partial_j|_p - (Y^j\partial_jX^i)(p)\partial_i|_p\\ &\in \operatorname{span}\{\partial_1|_p, \dots, \partial_m|_p\} = T_pM. \end{align*}
Therefore, if $X, Y \in \Gamma(M, TM)$, $[X, Y] \in \Gamma(M, TM)$.