If the system is too hard to develop for (Jaguar comes to mind), if the console embraces old technology (N64), if the marketing is poor (think Saturns "surprise launch"), it seems these are big reasons why third party companies jump ship. a lot of it has to do with oversaturation of the maket of course. presently, there are 3 main console competitors, each offering something different. but look back at 1993 when there were what ten different consoles with games being produced on them? (NES, SNES, TurboGrafx16/CD, Genesis, Sega CD, Jaguar, CDi, 3DO, Laseractive, not to mention all the handhelds.) Most consumers could only afford one console, and some had more than one. My family at that time only had an NES. we borrowed or rented the Genesis during that time and didnt get a SNES until 1995.
One thing I find interesting is how much third party support Sega had during the 16 bit days. damn near 1/4 of the titles seem to be published by Electronic Arts. By the time the Dreamcast was released, EA jumped ship a long time ago. Capcom seems to have been the only publisher that stayed by Segas side til the very end.
The N64 is an enigma because almost all of its good games were made by Nintendo
if it werent for Rare, the N64 wouldnt have had much going for it third party wise.
Sony was a juggernaut at swallowing up all the 3rd party companies like Square, Enix, and EA.
Nintendo right now I believe is thriving off the nostalgia bug that hit everyone in the mid 2010s. games on cartridges again, emphasis on local multiplayer, games that harken back to the 'olden days' and just the fact that the Switch is the continuation of the Nintendo lovers' "I GOTTTA BUY EVERYTHING" in the long list of consoles going back to NES. I think also Nintendo tapped into a distrust that gamers have with the competitors forcing things gamers dont want on them; mandatory installs, updates, microtransactions, etc. Nintendo seems to want to avoid that stuff from my perspective at least.
but going back to the 3rd party discussion... did 3rd parties leave the hardsare manufacturers because they looked at consumer trends, because of disputes with what games can be made on the platform (think Nintendos policy on violence), or because they banked on newer technology that they thought would be the wave of the future? the latter seemed to work for the 3DO as it really did have a solid market for the gamer who had $$$.
Obviously Sega is a big part of this discussion and most people say that their focus on hardware upgrades killed them but I think losing EA was hugely detrimental to them considering what the best selling Genesis games were outside of Segas IP.