Notice that on the middle stave, the notes with up tails are exactly the same as the notes on the top stave.This is because the right hand, playing the middle stave, is producing the melody line.
On the middle line are also notes with down tails.These are part of the accompaniment, played with right hand. The bottom line is standard bass, played with left hand.
The top line in songs written out in this way will always be the melody line, to go with the words printed above.
The other part of your question is answered with - the notes on LEDGER LINES are too low to fit on the middle stave, but too high to be played using the left hand. So they are written like that to make the tune playable. As in the second bar, the A and middle C# can be reached using the right hand, while the left hand plays a low F#.You wouldn't reach the A/C# with your left hand, whilst holding the low F#.
Also note that with ordinary music, written in standard form using treble/bass clefs, the tails are generally put up or down to keep it all looking tidy, so it's not going to be the same format as your example.