For example, I try to press the G1 key down without it producing a sound, and when I abruptly play the C1 beneath it, the G, an octave above, is clearly audible, although the string isn't free to vibrate. Why does that happen? Do strings an octave apart vibrate sympathetically?
Tim's answer is of course correct, but I'd like to offer a more quantitative way of saying the same thing. As others have noted, digital pianos emulate the sympathetic vibrations of acoustic pianos (well, some do, at least), so this answer describes how this works in an acoustic piano.
To restate the question, you press the G1 key slowly enough that the hammer does not strike the string, raising the damper from the G1 strings. Then you strike the C1 key sharply and release it. You hear G2 until you release the G1 key, meaning that the G1 strings for some reason were vibrating at the G2 frequency. Why do they vibrate at that frequency instead of at G1?
This has to do with overtones. A string's fundamental frequency is produced by a standing wave along the length of the string, but the string has other modes of vibration, at integer multiples of the fundamental frequency. These overtones correspond more or less to other notes in the scale. When you play C1, the first few overtones of the string are C2, G2, C3, E3, G3, B♭3, C4, D4, E4, F♯4, and G4. The seventh and 11th harmonics, B♭3 and F♯4, are particularly far from their equal-tempered counterparts, and the fifth and tenth harmonics, E3 and E4, are also not particularly close.
You don't necessarily hear these harmonic modes as individual tones; normally they blend to form a single complex tone.
Now the first few overtones of G1 are G2, D3, G3, B3, D4, F4, and G4. When you play the C1, the G1 strings are set in sympathetic vibration by the overtones of the C1 string. The third harmonic of C1 stimulates the second harmonic of G1. The sixth harmonic of C1 stimulates the fourth harmonic of G1. The ninth harmonic of C1 stimulates the sixth harmonic of G1, and so on. You're left with a harmonic series comprising G2, G3, D4, G4, B5, and so on. This is only a subset of the harmonics of the G1 string, but, notably, it is the harmonic series of G2, and that is precisely how the ear hears it.
Any piano string (or other, for that matter) will produce harmonics from that root note. The first few harmonics produced from a C string are the octave (C), the 5th above that (G) and the next octave (C).
So when the damper on the higher G string is opened, that G string will 'hear' the harmonic from the lower C and begin to vibrate in sympathy.
There are no strings attached, but possibly some clever software in their place, to get as close to what a piano does sonically.