It wasn’t millions in bitcoins. It was $2.3-million worth of bitcoin. A bitcoin is currently worth about $34000, so they had to buy about 67 bitcoins. As to where they came from, they came from other people who had bitcoins and wanted to sell them for dollars. Think of it like the stock market. I can place an order for $2.3-million worth of Amazon stock and I’ll get about 720 shares. Those 720 shares already exist and came from other people who already owned them and were willing to sell them to me.
As to why a bitcoin is worth $34000, again, it’s kind of like the stock market. That is the price where bitcoin buyers and sellers are currently meeting with their buy/sell prices. It’s the same with Amazon shares. Amazon shares are $3200 because that’s the intersection between buy and sell orders. If there are more buyers, the price goes up. If there are more sellers, the price goes down. These ransomware attacks can have the effect of making the price of bitcoin go up. The victims have to buy bitcoin to pay the ransom, so it helps raise the price. If no one was buying bitcoins, the price would drop way down.