It balances itself out. a portion of the miners leave making it proportionally more profitable for the remaining miners, or they upgrade to more efficient hardware reducing their power costs to mine the same amount of bitcoin, or the price doubles, or a combination of all of the above.
during some periods of time the price falls and it takes longer for all of that to happen, with existing miners being slowly replaced by more well capitalized miners