I agree with your sentiment, and that the world should work like your hypothetical.
how could they possibly ever know
Lawyers doing lawyer stuff. As to why, you said it:
I made mega money and they found out
We'd have to have real lawyers weigh in, but for the most part I think unless you found an undiscovered market then they won't care. Programming isn't unique in the respect that the tools you need to do world-changing work aren't that different between what you might have at home versus a well funded computer science research lab, but you're much more likely to stumble into a marketable app than you are a quicker FFT.