Hey fideirtorres!
So this is what I can gather from your post: you are currently working with a song that is based around two chords whose roots are G and Eb. From what you have said, it sounds like you have described an ionian mode chord-scale for the G major chord, or in other words, your run-of-the-mill major scale. This would be G, A, B, C, D, E, F#, G, for clarification. The corresponding intervallic pattern goes like this: whole-step, whole-step, half-step, whole-step, whole-step, whole-step, half-step, or WWHWWWH.
I'm not entirely sure with which music theory terminology you are familiar, but I will attempt to explain this in as straightforward a manner as I can. A very common harmonic pattern to employ, is I-major ("one major") to bVI-major ("flat six major"). What this means is that the bass note and corresponding major triad moves from the 1st degree of the ionian chord-scale, which in this case would be G, to the flatted-sixth degree of the same ionian chord-scale, which would be Eb (E natural is the sixth degree of the ionian chord-scale in G, so we will refer to the Eb in terms of the sixth degree).
There are several ways in which to interpret what is going on with regard to this movement, and also with which to analyze why this sounds good. First of all, this movement falls into a category known as "constant structure." (There is a Wikipedia article on "Constant structure" that you may find to be useful.) Essentially, it is a device that employs the use of the same chordal structure or shape, but over a series of changing tonic centers. So in our case, Gmaj to Ebmaj would be a perfect example of use of the constant structure technique. Now we can explore why this sounds so good in this particular instance. We may actually make statements about the functional use of the Ebmaj by extrapolating the chord from G major's aeolian mode, or the parallel minor chord-scale (we say "parallel" in order to denote that the root of the scale has not changed, but some or all of the other notes in the scale have experienced some form of quality alteration). The notes of the G minor scale (or aeolian mode) are G, A, Bb, C, D, Eb, F, G (WHWWHWW). By assigning a corresponding chord-scale/mode to each of the notes in the scale, we find that the flatted-sixth degree of the scale (bVI), the Eb, does in fact have a major chord-scale (ionian mode). In this manner we understand that one way in which to analyze or justify the use of the Ebmaj chord in this scenario, with relation to the Gmaj, in terms of music theory terminology, is the idea of "modal interchange," or the use of "borrowed chords." (More information on this subject is detailed under a Wikipedia article called "Borrowed chords.")
Hope this helps and best of luck with regard to your musical endeavors!
-Starseed