The copulas ser and estar in Spanish are used based on the nature of the adjective: ser for inherent characteristics and estar for temporary conditions.
Ser and estar are Spanish copulas used based on whether the adjective is an individual-level or stage-level predicate. For example, ser is used for characteristics that are inherent, like origin or identity, while estar is used for conditions that are changeable or temporary. In sentence 1, "Pilar es de Barcelona," ser is used to denote Pilar's origin, which is a characteristic. In the sentence, "La puerta de la habitación está cerrada," estar is used as it describes a temporary condition - the door being closed.