In the NMEA GGA-message the 11th field is
Geoid separation. How does the GPS-unit "know" this separation?
Are GPS units preloaded with an EGM (Earth Gravitational Model)?
GPS units can be pre-loaded with one or more geoids, which can be used to calculate elevations by geoid separation. But support for this feature varies by manufacturer and by device.
On many Trimble GPS units (and probably units from other manufacturers who make higher-end GNSS hardware for professional surveying), the geoid is stored on the device. Trimble uses a .GGF file. You can add new geoids and decide which one your unit will use. Geoids can be refined over time so the ability to add new ones helps keep your hardware up to date.
When it comes to a consumer GPS handheld like a Garmin or whatever, my guess is that they have one geoid and/or ellipsoid (another abstraction of the earth's surface that is used to calculation elevations) pre-loaded on the device which can't be updated. But you'd need to check the specs for your device and maybe contact the manufacturer to find out for sure.
Unless otherwise specified, a GPS unit is probably using the WGS84 ellipsoid and EGM96 geoid, and the separation it reports is the vertical distance between those two surfaces at the present latitude and longitude. Yes, it's usual to have that data baked into the firmware.