You could argue that the てしまう* doesn't technically add any new information to the sentence in the form of a subject or object, but that's not to say that it's not useful.
*This is the same thing as てしまいます but in plain form -- don't worry about it for now, it's not relevant to this discussion
Firstly, to clear up your question, the てしまいました is actually split up into 2 parts, します, and しまいました. In the 2nd part of your question when you mention the "まい" stem, that's not really what it is.
In this, the first part (します) is the verb "to do" that I'm sure you already know.
The second part, しまいます, is really what the question is about. It comes out as してしまいます because it conjugates as して + しまいます (て form in して is being used to link these).
〜しまいます shows two possible things:
1) That the action (します)was unintentional, like leaving your luggage on a bus when you get
荷物を網棚に置いたままバスを降りてしまいました。 (Don't worry if you don't understand this in Japanese)
I got off the bus, accidentally leaving my luggage in the overhead storage (an obvious mistake).
映画館で映画を観ていて寝てしまいました。
I accidentally fell asleep while watching a movie at the theater (unintentionally).
2) The action is over and done with now (with a nuance hinting towards regret), like the English phrase "it's over and done with", or eating the last slice of cake.
ごめんなさい。クッキーを全部食べてしまいました。
Sorry...I ate all the cookies (too late, they're all gone).
最初の結婚は失敗してしまいました。
My first marriage failed (but you didn't want it to).
In your sentence, it's hinting at the first -- you accidentally forgot to do your homework, and you regret doing so. Strictly speaking, you don't need to add しまいました. The sentence makes sense without it, but by adding it, you change the nuance of the sentence. As you'll see with time, a sizable portion of Japanese grammar deals with nuances of sentences rather than solid grammatical meaning. But, in this case, it's definitely natural to use しまいます, simply to represent the sentiment behind not doing homework (it was an accident and you regret it).