Depending on the verb, passé composé and other composite past tense either use the auxiliary avoir or être. There is no absolute rule to choose the auxiliary. Most verbs use avoir. Only verbs that cannot have a direct object (and hence cannot have a passive voice) can use être. Broadly speaking, verbs that express a state or motion use être.
If the auxiliary is avoir, then the past participle is invariant.
Ils ont eu trois enfants.
Ils ont divorcé.
Elle a bu trois verres.
(Note that it is also possible to say “ils sont divorcés”, meaning “they are divorced”. Here the past participle is used as an adjective, unlike in “ils ont divorcé” (“they divorced”) where the past participle is used as part of the passé composé.)
There is an exception: if the verb has a direct object (COD) which comes before the verb in the sentence, then the past participle that is part of the passé composé agrees with the object. A common case is a subordinate clause where the conjunction is the object.
Elle a payé les trois verres qu'elle a bus.
If the auxiliary is être, then the past participle that is part of the passé composé form agrees with the subject and takes plural and feminine marks if needed:
Les parents sont revenus de leur soirée.
Some pronominal verbs (se laver, se taire, …) are an exception. They use the auxiliary être but do not always agree with the subject. Roughly speaking, there is agreement with the subject except when the pronoun se is a direct object. This is a complex subject (which even natives have trouble with) and I'm not giving all the details here.
Ils se sont lavés.
Ils se sont lavé les mains.