It is related to performance issues.
Say your file contains 1000 lines, and you need to view line 50. If you give
sed -n "50p", then
sed would read through the entire 1000 lines, which is a waste. In case of
sed -n "51q;50p",
sed would read 51 lines, and then print the 50th line.