It's entirely dependent on the specific opportunity and your personal goals. You won't make as much as a law firm partner unless you are the GC or a direct report to the GC in a very large (generally public) company (outside of liquidity events that you won't control). The job security also isn't as strong, particularly if you are the GC or a direct report to the GC. Senior leadership changes (new CEO or GC) often trickle down to the management team which generally includes the GC and the GC's direct reports. You may also have to be willing to relocate if you decide to leave your in-house position and there isn't a comparable opportunity with your experience and industry expertise in your market. That consideration is extremely market dependent. Another current reality is that legal is an area corporate America utilizes to improve its management diversity (more of a public company consideration). This trend is rapidly accelerating to the point where white males are not even considered in some candidate pools.
In any event, it's a better gig than AMLAW50 associate, who are now routinely billing 2500 - 3000 hours a year.