There are occasionally times where some kind of data stream, which might be a file, has consecutive lines which are the same. A sorted file is one obvious place, but this also happens occasionally in log files. The uniq program will only output a single occurance of a line when there are N consecutive occurances in the input.