Elevator doors protect riders from falling into the shaft.
The most common configuration is to have two panels that meet in the middle, and slide open laterally. In a cascading telescopic configuration (potentially allowing wider entryways within limited space), the doors roll on independent tracks so that while open, they are tucked behind one another, and while closed, they form cascading layers on one side.
This can be configured so that two sets of such cascading doors operate like the center opening doors described above, allowing for a very wide elevator cab. In less expensive installations the elevator can also use one large "slab" door: a single panel door the width of the doorway that opens to the left or right laterally. Some buildings have elevators with the single door on the shaft way, and double cascading doors on the cab.