Tim's answer is a great explanation, looked at from the perspective of the melody. Depending on how you learn and understand music it will be easier for some people to see it from the perspective of the chords. This will expand on the correct observations of Michael and Bananach.
I use uppercase roman numerals, remember minus (-) means minor.
We have 5 Qualities of chords, grouped into families by how they sound. We'll just use the 3 most common for this:
- Major- Sounds big, bright, bold
- Minor- Dark, smooth
- Dominant 7th (or just 7th)-Tense, Jarring, (Funky or Bluesy)
Chords have 1 of 3 Jobs (or functions) based on their numerical position of their root note in the scale (we are counting the letters):
- I,III,VI create Stability (Official Title is **Tonic* Function*)
- II, IV create contrast (Subdominant Function)
- V, VII create Tension (Dominant Function)
The chords' function is based on their number, regardless of being flatted or sharped. A III-7 chord in Major creates stability, so does a bIII chord in Minor Key.
Here's why we change the V- chord to V7: The job of a V chord is to create tension, and go back to the I chord. This is the most critical job in music. The fifth chord of natural minor is minor, so it sounds dark and smooth.
It creates some tension, but why settle when we have a chord that's more or less born to do the job? The Dominant 7th chord. Its even named after its job. We replace the minor chord with a chord who naturally sounds tense all by itself to do the job and create tension. Its job is so important, that if we say 7th chord, its assumed we mean the dominant seventh chord not any other kind.
Another analogy: If your song was a cheesy summer action movie, at the height of the dramatic structure, the big shootout at the end, are you going to send your sissy pretty boy actor to jump out of a flaming helicopter? No, you bring in a stuntman who lives for danger.
What it takes to make a minor7 chord into a dominant 7th chord is raising one note (the third of the V chord). That note is the same note as the seventh of the natural minor, changing it to harmonic minor.