Entering or leaving the Schengen Area, or between other countries there are ID (passport) checks. Usually these are done on the train, you do not have to get off the train. The Eurostar between London and Paris / Brussels is a special case. Passports are checked before getting on the train, both exit and entry checks.