This may help. Basically, it converts characters that HTML doesnt like (ampersand and the like) to their HTML counterparts.
Basically, you needed the nl2br() function because the data was being stored with newline characters instead of <br> tags. Because HTML doesnt recognize the newline characters, it was displaying it all on one line.