How can I learn the sed branches in Linux

view story

http://stackoverflow.com – I am trying but could able to understand the branches in sed. Why do we need it and what purpose does it solve? Example in this solution of removing the \n from the file, he uses: sed ':a;N;$!ba;s/\n/ /g' I am not able to understand the labels. (HowTos)