Even at that, it isn't just about making a profit, it is about making more profit (or often just revenue) each quarter. Your business could be operating at a 40% profit margin that but be called a failure and run against on the stock market when that doesn't become a 41% margin next quarter.
This is not complicated. You buy with the expectations of future profits X. If the stocks fails to meet those expectations, you reallocate your capital by selling to someone else who is happy with <X.
There is nothing nefarious about it. Nobody is a failure. The system isn't broken. This is the free market.
The point is that the free market may not be good for long term R&D because a lot of buyers/sellers are speculators with expectations not aligned with long term company viability.