(Please also read More about Triads, as I wrote it first.)
Take a Major Scale, use every other note up to the 5th note, and you have a triad:
Every other note from start to fifth, is:
This forms a triad. These three notes sound pleasant when played together, because they're all in the key of D Major.
Why do we need Triads? They form a basic Chord. Improvisation happens while Chords are playing.
To improvise a made up melody, we must know our Key (which notes to sharp or flat). We'll have to find our Chord's root (called Tonic, or 1st note of a scale).
The Chord's Root is one note to which every other note revolves around, or resolves to, in sound. Play or sing a few notes near the chord notes you hear. Then play up or down that scale, to reach the bottom or top root note.
When you find the Root, build a triad from it. You will need the Root's Key signature (which notes are sharp or flat).
If the note is E, then E Major is a Key with sharps. The sharps rule moves E a half step down, to D#. Then, count up to D# with the Order of Sharps:
FCGD notes are sharp now.
Use these sharps in the Scale alphabet, starting at E (Root):
That's the E Major Scale.
Now, let's make our Triad: Every other note up to the Fifth (5th) note is:
That makes the E triad.
For a simpler method, count every other note in the E scale:
Then, find the Key Signature, which is the correct Sharp notes in the triad:
That forms the E Major triad.
Additionally, Triads help us to play a solo, or improvise, since we need a reference for the patterns we play. The anchors of first, third, or fifth notes marks our location in a scale.
Triads give a melodic structure, inspiring other scale types, key change prediction, and arpeggio (note pattern) creation.
Therefore, Triads are shortcuts to remember a Key, and are chords that change as a song plays.
Recommended reading: More about Triads