All patents issued by the USPTO are public though. For you to get a utility patent you need to publicly share exactly what is done. This is supposed to be the reason patents exist in the first place. And in return for publicly sharing, you get exclusive rights for some period of time. In that regard there really isn’t any secrecy
Just because you have the patent does not mean you will win all infringement claims though, as you noted with those Newegg cases