Money solves all their problems, if it doesn’t solve everyone else’s then fuggem
The iPhone was long after Apple was a majorly successful company that people wanted to emulate.
Microsoft also never just gave Apple money for no reason. They settled Apple Computer, Inc. v. Microsoft Corporation by agreeing to continue to develop Office for the Mac and to purchase $150M in non-voting Apple shares, and both companies agreed to cross-licensing of OS patents.
They also weren't on the brink of bankruptcy when they made the iPod either - the original iPod launched in 2001 which was ~4 years after the Microsoft investment you mention (that happened in 1997).
Apple actually launched the highly successful iMac (the colourful ones) back in 1998, and it was arguably the success of that which restored Apple to having good profitable. I.e. it was already well on the 'up' by the time the iPod launched and propelled them to even greater financial success.