I'd like to add just one point to the fantastic answers already posted. Publish or perish often tends to favour quantity over quality, so a researcher who publishes 5 papers per year in mediocre journals may be seen, on paper, as being more productive than a researcher who produces an actual groundbreaking work once in two years.
This is common in places where the assessment of performance is done centrally, such that the assessors are not necessarily experts in one's field, and may not know the value/quality of different journals. In such a case, the number of publications becomes an easy metric to use. Over time, this incentivises low quality, high quantity work.
The perish could mean denial/delay of tenure, promotions or salary hike.