There are smoke detectors in all elevator lobbies.
If smoke is detected, the elevator doors will automatically close and the elevator will return to the main floor when the fire alarm is activated.
The elevators have an override, the "Fireman's Key Control," which allows emergency personnel to control the elevator and use it as needed for moving people and equipment.
In a modern high rise building, there is an annunciator panel in the control room which indicates the location of the elevators and whether they are operational.
The electrically driven, cable-operated machinery which runs the elevators is an impressive size.
Elevator Controls - Smoke Detector
Elevator Annunciator Panel