Because they're the ones making hardware people don't want.
Well those 70+ million people that bought Nintendo systems this gen doesn't count?
That's addressed in the OP.
1. They don't have direct competition, lack market understanding on building hardware (while they do on software), they keep losing market reach keeping tying their games to their hardware, and have no services built around their hardware to justify it.
Their strength lies deeply on their software, like any third party company.
Well i disagree. Yeah i can agree they make underpowered hardware but that doesn't mean they don't understand the market on building hardware.
3D was really popular so they made the 3DS which ended up being a success.
Tablets and gaming on tablets were and still are big when the Wii U came out and yes it did fail but that's like only 1 mistake,
Now they noticed how popular taking games on the go and know that they want to throw all their support on one system so they made the Switch. Yes its nto as powerful as other consoles but power shouldn't be what we use to determine that they don't understand the hardware market because they seem to be doing whats popular and it only failed once with e Wii U.