If there is an emergency and a main performer is unable to perform, the understudy will take their place. Very often the understudy is a member of the chorus who might have had a small part in the performance anyway. Sometimes an understudy is called a "standby". A standby is usually not a member of the chorus or ensemble. They may be required to be present in the theatre during the performance, or part of it, in case of an emergency.
Sometimes an understudy will become famous when they unexpectedly have to perform instead of the usual lead person.