Number of Nintendo published titles in America by platform:
NES: 72
SNES: 52
N64: 53
What should be analyzed is the context on which said first-party games were released.
On the NES Nintendo had a first mover advantage due to the unforeseen success of their own console platform (which birthed the mainstream console market in Japan and revived the one in North America) and many of the early Nintendo games were successful due to this advantage but such success was hard to translate into successive generational iterations (think at the sport "simulations" with generic names like Soccer or Golf).
Since early on (I'd say the signs are there at least as early as the second part of the NES lifespan) Nintendo's management had the foresight of orienting the company into finding unique new game formulas with wide appeal that could become genre kings and could be iterated generation after generation.
This effort paid big dividends for Nintendo's future however was a slow and hard process to pull off that required many years (still is in effect).
So each generation brought new strong game franchises to foster Nintendo's first-party arsenal and at the same time more time and resources were necessary to produce worthy sequels or birth new game formulas with the typical polish that characterize Nintendo.
First-party sales on game systems therefore depended on the overall popularity of said system but also on the expansion of the first-party game series portfolio.
The jump to 3D was particularly hard for developers and kind of a reset of the industry in many ways.
Nintendo could muster efforts above other game publishers due to the constant internal growth and by having a hardware expressely designed to catered to full explorable 3D worlds (not just displaying polygons).
They started open up more and more to partners to cross manage new successful series (Hudson Soft is managing a popular board game in Japan? let's partner up to create a Mario based board game popular worldwide, Camelot has create an arcade sport game popular in Japan for SCE? let's partner up to create a Mario based arcade sport game popular worldwide).
While the fortune of platforms fluctuated each times, the arsenal of first-party game franchises keeps engrossing after each generation.
If you check the list of best selling first-party games on Switch, many are game formulas created early on (often on N64 due to the importance of having been the first Nintendo 3D console).