Insaf, hi.
The Ground electrode in EEG or ECG has TWO functions: primarily it acts as a way to center the differential amplifiers used on each channel (between the measured site and reference.) This helps the electronics to compensate for any DC offsets present.
Secondarily, the ‘Ground’ electrode is also sometimes referred to as ‘Bias’, because it is used to inject a small voltage back into the subject, that is 180 degrees out of phase with the common mode noise present on the channel / reference pair. This helps to further cancel out the common mode noise. Which is primarily from mains currents in the area.
Regards,
William