(Not a teacher, just curious)
After thinking about this, using matter in this way is very abstract and contextual.
The best definition I can think of is "The substance of a situation", but this does not imply how important the situation is. It can be important or trivial.
Small matters
Big matters
Political matters
"What's the matter?" (What is the problem?)
Matters of the heart
The difficulty of overcoming a situation or the challenge (or a lack of challenge) "It is simply a matter of doing these things."
In this example, "In a matter of months", it implies that passage or time was insignificant or unimportant, no challenge. Without context, to an outsider, how does one know the significance of the situation? Maybe it was a big matter.
The worst is "Matter of fact". This phrase makes little sense to me when I try to analyze it. I typically translate it to mean "serious", but now I'm not so sure.