The behaviour of stdout handling (at least in glibc) depends on whether it's a terminal: terminals get line buffering, pipes and regular files get a fixed-size buffer. This means that a program that runs for a long time and slowly outputs stuff to stdout will appear to be stuck when its output is redirected to a file _or even piped to `tee`_.
@b0rk
For that reason also running `foo` and `cat | foo` will exhibit different effective stdin buffering behaviour -- in the former case `foo` will see your input line-by-line while in the latter likely will see it only once you send EOF (the buffer is iirc 16KiB).