Value of anything exists as long as people believe in its value. So the main factor - the belief of people around the world in bitcoin. Anything can live long (even some total shit) untill it's believed. It's same about money, stocks, gold and anything like this. Our faith is the core of any value.
Bitcoin does not just have perceived value. Part of its value is due to the cost of production.
Just like gold it is mined - but in a different way.
The cost of mining has a large impact on the value at the time.
When value goes up and there is a large profit margin so mining increases.
When the value goes down below the value of the cost to mine - people turn off miners.
Some mining operations cost more than others due to varying factors. Type of equipment, cost of power, cost of other expenses and whether the operation is commercial or just a hobby.
Other considerations come into it as well. I live in a cold climate. Fiat (money) to BTC conversion is expensive (exchange rates, delays and bank fees). So mining brings heat and regular bitcoin.
Chart source:
https://www.zerohedge.com/news/2017-11-04/bitcoin-vs-gold-which-ones-bubble-how-much-energy-do-they-really-consume