I don't use the component, and I therefore don't know what the hack tries to achieve.
I would normally expect that there would be a subclass of TDBGrid, and that subclass then incorporates the functionality. And in the Form/designer you would add a TSubDbGrid instead of a TDbGrid?
But it seems that is not wanted.
So the hack uses the way the loader works, and the shortcoming of the designer to see the difference between the 2 classes (and the are 2 distinct classes, the new TDbGrid is in every way a new class as TSubDbGrid would be / just has an overlap in the name)
=> btw, have you tested that in lazarus 4.99 (with fpc 3.3.1)? Afaik Lazarus 4.99 has a designer (if not yet, then will eventually) that does see the DbGrid.TDbGrid and YourUnit.TDbGrid as different (I recall someone was talking about implementing that). So not sure what will happen to that hack....
But back to the hack.
The (old) designer only checks the not-qualified name. And so it does not realize there are 2 classes.
When loading a form from the lfm at runtime, then the loader looks at the class declaration
Tform1 = class
{published}
MyGrid1: YourUnit.TDBGrid; // YourUnit is derived from the scoping, and not given in the code, but the TDBGrid points there.
The runtime lfm loader, also only has the non-qualified class name, but the TForm (RTTI) resolves that to the replacement.
So it calls create on the replacement call, because the unqualified name TDBGrid in the TForm resolves that way.
So technically the result is the same as registering TSubDbGrid, and putting that on the form (which apparently you had been doing before).
And as you have noticed the hack does not, and can not affect subclasses. Because they define there own inheritance, and the trickery does not work on that part.
Not sure what was meant by using VMT => maybe to find which "virtual" methods you may need to overwrite. But that still needs to have a subclass.
All other play with VMT (virtual method tables) is not recommended. (E.g. you can create your own class at runtime, but you can also shot your own foot while doing so...) - not sure how that would help...
You could also (not sure / I guess) at runtime play with the RTTI (maybe that was meant and mixed up), and before loading bend the pointer to the class... But that is pretty hardcore... Not something I would recommend...