Here are the reasons for using this hand position.
1. Being able to feel the strings on the palm of your hand will help you judge where the strings are more easily. If your hand is completely in the air, you would have a harder time finding and picking the correct string.
2. You are trying to develop a picking motion that comes from your wrist, not your fingers or arm. Touching the strings helps you in the development of this movement.
3. Noise reduction. Touching the strings lightly will reduce the amount of stray noise from the strings other than the one you are picking.
Obviously you can not touch the string when you are picking your 5th or 6th strings. But you can maintain the same hand position. One way to think about your hand position when you are picking your 5th and 6th string is this. Pretend that you are touching your right hand where the 7th and 8th strings would be if you had an 8 string guitar.
Here are a couple of videos of my right hand as I am playing a basic major scale.
When you are strums chords, your right hand will not touch the strings. You are going to keep your hand in the air and strum using your arm and wrist. Here are a couple of lessons that cover strumming chords.
Chord strumming 101 - an intro. to basic strumming patterns for guitar
4/4 accompaniment strum patterns - Learn these basic guitar strums with some familiar song examples.