Unlike today, where we have multiple Surface-branded products, back then Microsoft only had Xbox, which operated as an entirely separate division from Windows + Office.
Before the Zune, MS tried to be the software partner for non-iPod devices, with the Windows Media Player store and Plays4Sure DRM standard (which they botched). It's only after it all failed that they rushed into the market with the Zune, which was a partially redesigned rebrand of a Toshiba MP3 player that was in the works.
Microsoft introduced a hard drive based player years after the flash based Nanos were already more popular.
Then MS released the flash based non touch screen Zunes after the iPod Touch was becoming popular.
Finally they released the touch screen Zunes after the App Store came out and the Zunes couldn’t run third party apps. Even the hard drive based iPods had a few curated third party apps by 2005.
The Zune came out in November 2006 - less than three months before the iPhone was introduced and a little bit over a year before iPod sales started declining.