Last year I grew aubergines (eggplants) and tomatoes with grafted rootstocks, and they actually produced a lot more veg than my other plants.
Could someone tell me why it is done and why they produced more veg?
The principle is to combine the superior growing/rooting characteristics of the root stock with a graft either:
The fact that the graft produces more or better fruit than the rootstock would is simply due to genetic difference within the species or subspecies (i.e. tiny differences). The main reason why the graft is not just propagated directly by its own seeds is that the rooting and other infrastructure of that graft is known to be weaker and thus more vulnerable to weather, disease, etc, than the rootstock.
I haven't heard of it being doing with vegetables, but grafting is common with fruit trees. I assume the reasons are broadly similar for your aubergines.
For fruit trees the main reason is so combine the characteristics of the root stock with those of the above-ground tree. For example, you might want to grow a particular variety of apple, but that apple conventionally has a large tree which you do not have space for. So you choose a graft that has a dwarf root stock. This is from an apple variety which produces a small tree - it might produce bad apples, you don't care. The small root stock limits the tree size, but the graft is what produces the fruit you are after.
Also with many fruit trees (especially apples), they are not true to seed, so you must propagate with cuttings or grafts if you wish to preserve the variety (a Granny Smith pip will not grow into a tree that produces Granny Smith apples).