The generic alternative costs about $9000 a year, so it's clearly a difficult drug to manufacture and supply. And 100k a year makes a great headline, but what does the average consumer actually pay? 100k a year is the starting point for negotiations for insurance companies not the price they pay. Wikipedia says the NHS (UK) is getting it for about 30k USD and the average in the US was 85k USD
https://en.wikipedia.org/wiki/Imatinib
Plus, Companies profit or die based on revenue and costs, not prices alone. Since only about 6000 people a year get the main form of Leukemia this drug was developed to treat, it's pretty niche. Assuming all 6000 people are diagnosed in time and all are treated with this drug and all pay the 85k (or their insurer does), that gets you $510m a year.
But wait! We already said it costs about 10k for the generic. So when you take that off, the gross profit is $450m (per year for the US market).
Multiply that up by the 10 year average use span and you get 4.5bn a year and a 10 year patent gives you 45bn. Very juicy!
Except that developing a new drug costs 5-10bn USD
https://en.wikipedia.org/wiki/Cost_of_drug_development
And the success rate is something like 38% from Academia to Approval. So if you spend 7bn each on three drugs, it's cost you 21bn to develop the one that gets approved.
So about half of that juicy 45bn is gone just on development costs. Plus you're investing in development for a product that won't sell for maybe a decade and you need to factor in the risks (that none of your drugs work, that someone else beats you to market, that a better drug comes along, that some other treatment cures the disease you're targeting, that your drug works but turns out to be toxic in some other way and you have a huge lawsuit to settle).
Suddenly, if I were an investor, that 85k average price suddenly looks ok but not amazing. And remember, the price hasn't been 85k the whole time, it was 24k (or rather it was whatever insurers negotiated below 24k) in year one.