The company gets the proceeds from the sales of shares on the open market. If a company is selling 1,000,000 shares at $12/share then they will receive $12,000,000 from the underwriter minus some fees that the underwriter will collect.
The part that ties into valuation is to consider what percentage is the company selling of itself that is coming from its own holdings.
What is an IPO? And Why Do Companies Like Lyft & Uber go Public?
If the company is putting out 10% of its shares in the IPO from treasury holdings on a $10B valuation then it will get $1B minus the fees I'd suspect.
Where I worked in late 1990s/early 2000s had an IPO where the underwriter did a bridge loan and the IPO so that the company didn't get all the money raised but did get enough to run operations for a while before ending operations.
Public Offering notes that after an IPO other offerings would be called "seasoned equity offering" that may or may not be dilutive as they could come from new or existing shares.