depends on what you're referring to- if you're talking NEW games for current gen systems and the fact that, say, a Mario Kart or Pokemon game will stay roughly the same price (for a new copy) for the majority of their active lifetimes (when their hardware is current)- it's due to Nintendo just being aggressive and not dropping the prices of stock for retailers at any point. Nintendo realizes that people who buy their systems, whether early in a lifecycle or late, are going to universally generally want to get the big first party games (Pokemon and Mario). So they don't NEED to lower the prices on software, the games will sell regardless
if you're talking about long term why Nintendo first party games as a whole seem to retain their value so much better than most others- it's due to them having a gigantic nostalgic fanbase. Mario Kart or Zelda on the Nintendo 64 remain quite expensive to buy complete because they have unusually rabid fanbases in the Nintendo corner. Nintendo also, as you all well know, has a tendency to do things their own way. So the majority of past generations there has been something about the games, hardware, software as a whole- that makes them often more appealing to collect for. Whether it's because people enjoy cartridges/physical media, or some unique spin (mini discs for the Gamecube).
Really the reasons Nintendo games tend to remain high in price, whether new or vintage games we're talking, in the end is due to the big N having the most rabid fanbase in the industry who are constantly willing to pay a premium for their titles.
I will admit it is weird to see Horizon Zero Dawn randomly drop to like $30 sometimes on Amazon, and then to basically never see Breath of the Wild under $50 (new), despite them releasing at the same period of time. But it all comes down to Nintendo feeling comfortable with not lowering prices because sales will maintain for the most part. With software it works, sometimes hardware not so much (some would obviously argue Nintendo should have lowered the price of the Wii U).