If a main performer is unable to perform, the understudy will take their place. The understudy is often 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 a problem.
Sometimes an understudy will become famous when they unexpectedly have to perform instead of the usual lead person.