"Publish or perish" refers to an ethos, common in modern
academia, that places strong emphasis on the production of published work over, or perhaps to the exclusion of, all else.
The fundamental basis of the "publish or perish" mindset is the fact that it's hard to judge the quality of any one academic's work. Every now and then one individual will revolutionize their field - Einstein and Darwin come to mind in the sciences, likewise Marx and Derrida in the humanities - but the bulk of academic output lies in extending and applying their theories, or in achieving small gains in the understanding of a particular specialization, gains which might go on to form part of the basis of the next paradigm shift... or alternately, pass on, mostly unnoticed, into the ether of the forgotten. Without the benefit of hindsight, the relative "importance" of any single person's work is difficult, if not impossible, to quantify.
This lack of objective criteria does not mean that there are no bases on which academic output can be judged, however. The publication of an academic's work by a peer-reviewed journal or press signals that some respected figures in the field have found it interesting and worthy, and their books and papers' later citation in the work of others indicates that they have to some degree influenced the thinking of others and contributed to the advancement of their field. Thus as one of the only available measurements of the quality of an academic's work, the volume of published material and its citation by others is given heavy attention by bodies like tenure and hiring committees and those issuing grants, fellowships, or other awards.
If there's one basic lesson worth remembering about human economic behavior, it's that you get what you pay for - that is to say, if you reward action X, you will see the incidence of action X increase. And just as office workers will tend to work with an eye towards the criteria of their yearly performance reviews, if academics work under a system in which there is a strong incentive to get material published, publish they will. If there's an addendum to that basic lesson worth remembering, however, it's that you get what you pay for, and the law of unintended consequences ensures that that and what you actually want aren't always the same. When you make quantity and frequency of publishing your guideline, you get quantity and frequency of publishing, but there are no guarantees beyond that, and the "publish or perish" culture has several notable drawbacks.
First, the focus on maximizing published volume may affect what gets published. So as to have as many articles to their name as possible, academics are pressured to submit papers for publication just as soon as they have enough material to make it a worthwhile endeavor, rather than "saving up" several ideas, insights, or theories to produce a longer, more complex, better contextualized work that might function better as a whole than the sum of several smaller papers. To ensure publication, academics might also attempt to play to the interests, and ideological biases, of journal review boards or other prominent academics whom they hope to garner a citation from, rather than focusing their work on their own interests or fields where they might produce a more significant contribution.
Further, the combination of every professor, assistant professor, lecturer, graduate student, or other ivory tower aspirant putting out papers on a regular basis, the constant growth of new fields and subfields of study, the desire by many to sit on an editorial board and exercise the attendant influence on their field, and the (sometimes justified) beliefs of some that their work, and thus chances for advancement, is being suppressed for ideological reasons leads to a steady increase in the number of academic journals and other publications which libraries must purchase expensive subscriptions to and academics must read in order to remain current.
Likewise, while in addition to research and publication, most university academics are tasked with the jobs of undergraduate teaching and advising, these duties do not contribute towards publication, and may be slighted by academics who remain distanced from their students and rely on teaching assistants to conduct much of the actual process of education. While student feedback may be factored in to the considerations of tenure and hiring boards, they are often given less weight than published work, especially at high-profile "research universities" - Western academia has long venerated the production of knowledge as its primary goal, with the training of the next generation often conceptualized as more of a means to this end than a goal in and of itself.