The simple answer is, it is either the diference in the sound of the chord (Major vs Minor), or the difference of the key, or tonality of a particular piece or section of music.
@RedDeerGuy1 “I don’t understand. Is it only for piano? I don’t understand any of the answers.”
All music (European/American especially) is based on the piano. The other comments about transposing instruments and such, while they are accurate and interesting, may cause confusion. It’s like trying to explain string harmonics to someone who just wants to learn a few chords on guitar.
I could go into an in-depth “lecture” on music theory, but I see that’s already been done.
Here’s a YouTube video showing the C Major scale.
Here’s a YouTube video showing the C Major chord.
Here’s a YouTube video showing the C Minor scale.
Here’s a YouTube video showing the C Minor Chord.