A smooth $k$-dimensional manifold $M \subset \mathbb{R}^{n}$ is a subset of $\mathbb{R}^{n}$ that can locally be characterized as the graph of some smooth function $\mathbb{R}^{k} \to \mathbb{R}^{n-k}$. In this sense, it makes sense to call this manifold $k$-dimensional since, locally, we only need $k$ out of the $n$ variables to "generate" the remaining variables. This is the technical definition of a manifold.
Intuitively, a manifold to me is a lower dimensional structure in a higher dimensional space. For instance, you can take a line in $\mathbb{R}$, take it into $\mathbb{R}^{2}$, and get an additional direction for you to "move" the line in (which wasn't available to you in one dimension). Similarly, which can talk about two dimensional subsets becoming surfaces in $\mathbb{R}^{3}$ (where we can again move them in an additional direction now), and so forth.
How does one connect the two notions of manifold above? How is the intuition of the fact that a $k$-dimensional manifold in $\mathbb{R}^{n}$ can locally be defined by only $k$ variables that we're taking a $k$-dimensional structure and being able to move it in $n$ directions (instead of just $k$ directions)?