>>32092771. They don’t, in fact, have better bodies and glass. Some Nikon bodies are better than some canon bodies; some Nikon lenses are better than some canon lenses. The reverse is also true.
2. The actual difference in quality between them is generally too small to actually be perceived outside of a test chart displayed at 100%
3. Canon has done a lot of things better than Nikon, technologically, over the past few decades. So much better that it gets people to switch to Canon. After that, momentum keeps people shooting Canon even when Nikon catches up and even creeps a bit ahead. Examples: autofocus, CMOS, full frame sensors, video.
4. Network effects. People shoot canon because their friend shoots Canon, and Canon is the top selling manufacturer, so more people have a friend who shoots canon.