Consider an inventor who has nothing to do with spirituality but her innovation helped change lives of millions. Her innovation helps people even after her death. Further, innovations can be used for evil as well.
The Buddhist version of karma may not be the same as the version of karma in other Indian religions.
It's not a system of cosmic justice. If you invented something to help millions of people, you would not get more rewards compared to someone who helped just 10 people.
In Buddhism, karma is about cause and effect, due to intention and volition (see this page). It's about one's state of mind and its expressions in actions and words. It's not about the impact made on the world or on others.
This means that one who has unintentionally helped others, but out of originally evil intentions in mind, he would experience negative karmic results.
On the other hand, if one had good intentions, but his actions inadvertently harmed others, he would still experience positive karmic results.
It's all about intentions.
From the Dhammapada:
Verse 1: All mental phenomena have mind as their forerunner; they have mind as their chief; they are mind-made. If one speaks or acts with an evil mind, 'dukkha' follows him just as the wheel follows the hoofprint of the ox that draws the cart.
Verse 124: If there is no wound on the hand, one may handle poison; poison does not affect one who has no wound; there can be no evil for one who has no evil intention.
From the Nibbedhika Sutta:
"Intention, I tell you, is kamma. Intending, one does kamma by way of body, speech, & intellect.
So, let's get this straight. If you get an answer of how Karma works for the particular situation you're mentioning, OR any answer at all as to how Karma works, then you may be lead the wrong way. Because you need to understand that all this is NOT true in your experience. It won't make a difference.
You may ask the question and somebody may give you an answer. You can either choose to believe or disbelieve that answer. But, consider this. What is the truth? Will you be closer to the truth by either believing it or disbelieving it? Contemplate this.
Karma depends on the mindstate. If she invented something with the intention that it will be beneficial to others, it is good Karma. At least if she became happy after seeing how others benefited from her inventions, it's good Karma. If no such thoughts arose in her mind, it does not amount to much other than improving her worldly skills.
The fundamental structure and workings of Kamma is the same for all beings, i.e. "only mangos can grow from a mango tree", meaning that only wholesome intentions can cause wholesome future resultants to arise and vice versa.
The exact workings of a beings Kamma cannot be known, unless one is a fully enlightened Buddha.
Its volition, intention (cetana), that is kammically potent.