The intervals in a chord do define what the chord sounds like and how it functions or operates, but the intervals are felt in relation to a root note. (And as explained later, in relation to a tonic) Where does the root come from? Perfect fifths and fourths have a special role in pointing to a possible root. In addition to that, whatever is the lowest note i.e. bass, is a dimension in the chord, but it's not the same thing as root. G - C - E does work as a C major chord, but if you're expecting C as the tonic, home note, then G - C - E doesn't feel as much like being home as C - E - G.
The C - G interval in both of your example chords is a perfect fifth (or fourth if it's G - C) point to C being a possible root, and the "third", E or Eb, is felt in relation to that. It doesn't matter which of the notes is higher, C or G, the interval points to C being a root. G - C - E is a C major chord, because G - C points to C being a root. But if we move C down a half step: G - B - E, then the root-defining fifth/fourth is B - E, which points to E being a root, and the G makes it an E minor.
If there are no fifths or fourths, then the bass note has more weight in defining the root. C - D - E would be some kind of a C major chord, but C - D - Eb is some kind of a C minor chord. But E - C - D? At least it's not E minor or E major.
One more thing that affects how notes in chords are perceived is the tonic, the expected home base note. For example if you heard your example chords after having established Bb as the tonic, it would make you feel different about them compared to if, say, C was the tonic.
It's possible to have several fourths or fifths in a chord, and then the effect or "meaning" of the chord comes even stronger from your expectations. What is a G - C - F chord, is it a Csus4 waiting for the F to resolve down to E, or G7sus4 without a fifth waiting for the C to resolve down to B? Or maybe "F sus2", not waiting for any resolution that much? What it feels like depends on what you expect. Even rhythmic placement in a phrase or other longer structure has a role in setting expectations. You can experiment with this by establishing a tonic by playing a cadence. For example, establish F major by playing the chords F, Bb, C7, F. What does a G - C - F chord feel like? Then establish C major: C, F, G7, C. What does the G - C - F chord feel like now?
To put it all together, the sound and function of a chord comes from: all its intervals, in relation to (1) a root note, (2) the bass note, and finally the/a (3) tonic note which gives an additional point of reference. You could even add other note-expectations as points of reference as well. Like for example if you expected C - Eb - G, but got C - E - G instead, then it feels a lot different than if you had expected the C - E - G.
There are non-functional (if that's a music term) aspects to the sound of chords as well, namely chord voicings, which means the spreading and/or doubling of notes in different octaves. A wider spacing gives a different sound than a narrow one. If you move your E or Eb up an octave, so it's C - G - E or C - G - Eb, it's a different sound even though the major/minor aspect doesn't change.
Edit. The OP asks:
Just to clarify, what's the difference between the tonic and the root?
A chord has a root note, but a tonic exists outside individual chords. There's no tonic in any single chord, but there can be a tonic in your mind. When people say that a song is "in C", it means that C is the tonic. It is a home note, center of balance to which your mind relates other notes and chords. When analyzing or listening to a single individual chord, naming a tonic would be conceptually incorrect, because tonic is not a property of a chord.
When exactly is a tonic set? It's a slightly fuzzy phenomenon that needs time to settle in, so it's not an immediate on/off switch. If you've spent awhile without hearing any music, then hearing even a single chord might set the tonic. But if you had been listening to a song that's in F, hearing one C major chord immediately after that most probably won't set the tonic to C. You will hear the C major in relation to the F and it won't feel like home. In this case, resetting the tonic somewhere else can require more powerful means. Keep a moment of silence and play a cadence.
If you play the chords C, F, G7, C, it will most probably cause C to be established as a tonic note in your mind, and C major will feel like the tonic chord. If not, play the cadence C, F, G7, C a few more times. Now, having C as an expected home, C major will feel a certain way, and F major will feel a certain different way, even though they are both simple major chords.
These feelings would be different, if you had a different tonic in mind. Try it. Establish G major as the tonic by playing G, C, D7, G a few times. How do the C major and F major feel now? C doesn't feel like a home anymore, and F feels quite different and special, doesn't it? Even a simple chord can sound unfamiliar and more complex, if it's played in an unexpected place.