If you're talking about Parents/Clones......
They are variations that can be found on the actual arcade boards.
If you bought two MK boards off ebay. One might turn out to be software revision v2.0, another might turn out to be revision 5.0
Problems were fixed or changes were made (in successive revisions) to the original boards to fix glitches, make the game work better, etc.
sometimes they are for different regions, i.e. North America, Japan, EUR, all the way down to individual countries that they may have had different versions for.
(the Japanese version of Vendetta has bad guys that prance around, then hump you. It just wouldn't work in the NA market)
(In Europe, Teenage Mutant Ninja Turtles were called Teenage Mutant Hero Turtles, so a different version was needed)
Other times, they are bootlegs or hacks. But they were bootlegs or hacks that were installed on real arcade boards, not made for MAME.
MAME is about preservation, so all versions found are preserved.
If you're talking about roms needing updated or rolled back to work with a particular version of MAME.....
I'm not as sure about that one, maybe someone more knowledgeable can chime in.
Sometimes not all chips on the board were dumped originally or there are other daughter boards or sound boards that weren't emulated in previous versions.
(i.e. the game used sound samples in the last version of MAME, but now the sound board is emulated)
A lot of times, they just rename stuff or change how it's organized.