I guess a different way to put it is. Anything has value as long as people believe it has value. Our economy could change to bottlecaps tomorrow (Sorry Fallout reference) Just like that the dollar bill becomes nothing. Then the economists and financiers figure out comparing the different currencies to come to a 'value' Was cryptocurrencies created out of thin air? (a very basic breakdown)...essentially yes, but when people started putting real monies in to change it to a cryptocurrency it gave it 'value.'
This is where cryptocurrency is like buying stock. You purchased the cryptocurrency at one price. Due to other people doing the same thing you're doing makes the price go up and therefore your currency that you bought has more value. If you were to sell it back to get your money back you wouldn't get back your orginal investment you would get back whatever the 'value' price is at that time. That is why prices go down. People worry it will not have value anymore so the either cashout or purchase a new type of currency.
I hope this helps.