Share price and profit are two very different beasts and only really have a loose connection to one another. Plenty of companies lose money left and right but still have high share prices.
The share price is just what the stock market feels a company is worth. It's almost 100% vibe-based.