You can understand it this way: Niu Niu's remaining 4 yuan is half of what she left after buying a ballpoint pen, so there should be 8 yuan left after buying a ballpoint pen.
That is to say, Niu Niu had 8 yuan before buying a ballpoint pen, and after buying a pencil case, all the money was left in half, which is 8 yuan, so Niu Niu has 16 yuan!
Do you understand? Little brother!