What happens when a patent is granted to an inventor but it is shown that the product actually has existed for some time, has not been patented, yet has been available to the public since before the inventor filed for the patent?
The patent would be much less valuable. Patents don't automatically go away because someone says it shouldn't have been issued but the patent owner would not have much incentive to assert the patent if it was pretty clear it would be found invalid in court. There are proceedures to ask the patent office to take another look at it but the lowest cost way to do that has a $6000 USPTO fee. Also, there may still be some aspect or version of the invention that isn't obvious under the old knowledge that can still stand up.