good example.
earning=> $20*20 = $400 and $40*15=$600.
fixed cost = $100 (cost of capital i.e. setting up the plant; cost of R&D; etc).
raw material/labor cost = $5 per unit (technically, labor cost reduces as we increase production and you not need extra labor to added units upto a certain point due to automation)
profit with $20 = 400 - 5*20 -100 = $200
profit with $15 = 600 - 5*40 -100 = $300
I have not done economics in 15 years, but the idea is to hit the "Optimal price range" that Dresdonboy illustrated. We of course don't know where this curve lies for GF, but I am sure AMD did the required math to maximize its profits.
This can be linked to why AMD might have asked Samsung to produce some chips for them as well, adding more production plants will shift the "Product earning" curve to the left enabling even lower prices, therefore higher demand and earnings.
We can at least expect, that while getting closer to Intel's price/performance levels, demand for Ryzen will drop more quickly. But as I said, it's difficult to get the picture of all this happening, as there are tons of layered curves influencing each other for each chipmaker's product stacks and the overall market.
But let's stay at the less complex level. The other part might be interesting for a biz sim game.

I found another nice diagram, showing the effects more clearly (and prices look more like CPU prices

):
from:
https://www.business-case-analysis.com/pricing.html
An interesting point is the shrinking unit demand at lower prices. Could that happen for CPUs? I think, it could in cases like this: The curve depicts sales for just one specific model. At lower price points, the remaining system costs (maybe already ~$1K) might not justify buying that specific model, as the higher performing one might just cost $50 more.