The guitar is tuned in fourths, with a major third between the third and fourth strings. This allows for a wide variety of chord voicings, as the same chord can be played in different positions on the neck. For example, the G major chord can be played at the third fret on the sixth string, the second fret on the fifth string, the third fret on the fourth string, and the first fret on the third string.
The piano, on the other hand, is tuned in octaves and perfect fifths. This allows for a rich and complex sound, but it limits the number of chord voicings that are possible. For example, the G major chord can only be played in one position on the piano.
In terms of the number of chords that can be played, the guitar has a slight advantage over the piano. However, both instruments are capable of playing a wide variety of chords, and the choice of instrument ultimately depends on the musician's preference.