When we play notes on a string moving up one fret at a time, the notes are ascending in pitch. Each note is higher than the last.
One Octave Higher
If you play any open string and then that same string as the 12th fret, you will notice that they sound the same but one is ‘higher’. So one has higher pitch but still they sound very much in tune with each other.
Example: Play that thickest string (E) open and at the 12th fret – they are both “E” but the 12th fret is one octave higher.
Two Octaves Higher
Play the thickest string on your guitar and then the thinnest string on your guitar, these are also both E notes but the thin string is two octaves higher. It should be obvious that this 6th string (thickest) has a lower pitch and the first string (thinnest) has a higher pitch. It should be clear to your ear that they are both the same pitch class (i.e. same note higher/lower)
If this isn’t clear, play both together and hear that they are in unison (i.e. not different to one another)