OP, I think maybe the terminology used in this thread is causing some confusion.
Lets say your friend owns 25% of company a. This means that he owns 25% of the share capital. It does not mean that he owns 25% of the accumulated profits although I do understand why he might think like this.The accumulated profits are not his. The accumulated profits belong to the company.
Decisions in a company are made by its directors and the directors are ultimately appointed by its shareholders. A shareholder with 75% stake has pretty much full control in a company.
In your example, if the majority shareholder holds > 75% shareholding
in company a, then that shareholder has sufficient power to decide what that company does with its funds. A minority shareholder really doesnt have much power or say at all.
So if I understand it correctly when you asked a question whether the minority shareholder in company a is obliged to invest funds from company a into loss making company b, I think what you really mean is :
Does a majority shareholder in company a (> 75%) have the power to invest funds from company a into company b, then the answer is , most likely, YES.
The accumulated profits belong to the company and the company is fully controlled by a > 75% Shareholder