ほとんど + [verb] ほとんど + [negative] ほとんど + の + [noun] [noun] + の + ほとんど
ほとんど means "almost", "almost all". Before a verb it says the action is nearly complete; before a noun it takes の and means "most".
Before a negative, ほとんど means "hardly", "almost not at all".
The の changes what the negative covers. With ほとんどの on a noun, the sentence is about most of the people or things, and they did not do it.