"Console wars" have occurred across all generations of console gaming, but typically the most well known use of this phrase is from the 16-bit era of gaming. TVTropes calls this the 'classic battle.'
During this time, Sega and Nintendo both aggressively marketed their systems, with many Sega ads directly attacking Nintendo, trying to paint the SNES as an inferior system for casuals and kids. This was generally unheard of at the time - Japanese companies found it inappropriate to do competitive advertising prior to this campaign.
In the autumn of 1990, Kalinske took over as CEO of Sega of America, and instantly began work on consolidating the new philosophy: that the Genesis was the machine that kids graduated to when they found the NES too limiting. “The starting point,” says Kalinske, “was that Nintendo was clearly the preference of the child gamer. To me, it seemed logical to really hammer the older audience, and to do that with more aggressive marketing, and with sports, strategy and role-playing games that appealed to teenagers and college-age males.”
At the time, I remember kids arguing about which system was superior, and you had to be able to defend the one you had, even though buying a console as a kid was basically impossible. You had whatever your parents had/could afford/were willing to buy you :)
Generally speaking, though, "console wars" occur every generation. Each console vendor wants you to buy into their walled garden and purchase their software exclusively. They take steps to keep certain games only available for their platforms, and they use aggressive marketing to make their console seem like the most desirable one.
Technically, there have been console wars as soon as the first Pong clone appeared. However, the SNES/Genesis era really defined the term, and the advent of the internet made these types of arguments far more prevalent.