A tree is a connected graph with $n - 1$ edges. If you take any edge away from a tree, the number of components increases. If you add any edge to a tree, a cycle is created. So, your situation is a forest of $n - m$ trees, i.e., $n - m$ connected components, each of which is a tree. If you take away any edge, it creates more connected components. If you add any edge, it adds a cycle. This is an intuitive way to think of it. Here's an actual proof.
Proof: Assume $G$ has no cycles. Then each connected component has number of vertices in that component - 1 edges, as each component is a tree. Adding up the edges over the various components, if there are $k$ components, gives $n - k$ edges. Since the number of edges is $m$, we have $n - k = m$, or $k = n - m$. This is what we wanted to show.
Now, assume $G$ has $n - m$ connected components. Each component must at least have number of vertices in the component - 1 edges. And, if we have exactly that many edges per component, we have exactly $n - (n - m) = m$ edges. Thus, each component is a tree. So each component has no cycles. Or, another way to think of this, if one component had more than that number of edges, we'd end up with more than $m$ edges, which would contradict the fact that we have $m$ edges.