It can't: regularly (every 2 weeks IIRC) the hash difficulty is ajusted, so that with the average hashing power available during the last period, a new block would be found every 10 minutes on average.
So if it becomes less profitable, some miners give up, the mining rate falls, and the difficulty is adjusted so that it becomes cheaper, hence more profitable, to mine.
So if it becomes less profitable, some miners give up, the mining rate falls, and the difficulty is adjusted so that it becomes cheaper, hence more profitable, to mine.