In Japan the Famicom was open, and it got flooded with junk like the Atari 2600 did. This threatened the same problems as Atari ran into.
The Famicom Disk System relied on a strange copyright check on the physical disks to make them harder to pirate. It worked better than nothing, but not perfectly.
The NES came out after the disk system but before the first mapper chips (which Nintendo controlled tightly for a few years) in 1985. By that time they had been through the problems in Japan and seeing what happened in America with the Atari crash
Nintendo, rightly, knew they couldn’t let it happen again in America. They needed to show their console wouldn’t be full of complete trash, so they used the lockout chip to ensure all publishers had to through them.
It’s a big part of why they were successful and able to reinvigorate the US market. It worked until the chip was cracked later in the console’s lifecycle. But by then the threat passed, the NES was safely ensconced.
They’ve never forgotten that lesson.
(No comment on fans)
It wasn’t just about protecting the brand, it was also every bit about collecting money at every single step of the production pipeline. They were able to not only have some better QC, but they were able to literally tell developers “no, you cannot make your game for anyone else. If you do, you’re not allowed to make it for the Nintendo, and that sucks for you because we have ~80% of the market.“
They did it so they could enforce what was functionally a monopoly on the games industry. Sega went to great lengths to undo Nintendo‘s grasp, and ultimately they weren’t even successful - they got a notable carve out of the market but it was still Nintendo’s industry.
It took Sony going on a revenge tour (touting their CD format and wildly generous/unsustainable licensing deals) after Nintendo backstabbed them to finally dethrone Nintendo and end the norm that was their walled garden/top down control of the console games world.