Step 1: Recall the flow pattern after sudden contraction.
After a sudden contraction, the flow contracts further to form a vena contracta.
Step 2: Identify the source of head loss.
The major energy loss occurs when the jet expands from the vena contracta to fill the smaller pipe.
Thus, the loss is mainly due to
\[
\boxed{\text{Expansion of flow after sudden contraction}.}
\]
Hence,
\[
\boxed{(B)}
\]
is the correct answer.