They don't know. Nobody does until the bill is processed. There are a thousand factors that might affect your coverage. This is the nightmare I'm living through right now. Even if you have the code and doctor and patient the help desk at the insurance company can't say for sure if they will cover it or not. That comes down to the discretion of the claims adjuster. You won't know if something is going to cost $100 or $10,000 until after it is done.
The provider or the insurance company? The provider can give you the cash price, but that's a made up number with no relation to reality. The Insurance company can give you what the standard discount would be on that procedure, but they can't say if they'll cover it, give only that discount, give nothing, or anything in between.
if you ask the provider you will eventually get burned. they can only give you the cash price as a backstop.
if you ask the insurance company you’ll never get an answer. providers are usually more helpful about what “should be covered”, but that’s not guaranteed.
seems like prior authorization is the only way to really make sure charges are covered but takes forever. but even then, if your insurance covers $x and they bill $y, you might get a balance bill in the mail.
point is, the market is heavily skewed against the consumer.