Background (skip if you know French)
In French, to generate the past tense, you use the past participle of the verb, attaching in front a conjugated form of avoir or être. For example:
J'ai mangé. (I ate) (ai is a conjugated form of avoir, mangé is the past participle of the verb to eat)
Je suis venu. (I came) (suis is a conjugated form of être and venu is the past participle of the verb to come)
For those with être, the past participle agrees in gender and number with the subject. For example:
Il est venu. (He came)
Elle est venue. (She came)
Ils sont venus. (They (male) came)
Elles sont venues. (They (female) came)
For those with avoir, the past participle does not agree in gender or number with the subject. For example:
Il a mangé. (He ate)
Elle a mangé. (She ate)
Ils ont mangé. (They (male) ate)
Elles ont mangé. (They (female) ate)
The above phenomenon is also found in other Romance languages such as Spanish and Italian, with their own versions of avoir and être.
However, what seems to be unique to French is that the participles that take avoir agree in gender and number with the object when the object is placed in front of the verb. For example:
J'ai acheté cette voiture. (I bought this car) The participle is acheté in its uninflected form (masculine singular).
C'est la voiture que j'ai achetée. (This is the car which I bought) The participle is inflected to agree with the subject (la voiture) which is feminine.
In French, past participles that take avoir are not inflected to agree with the object in gender and number, except when the object is placed in front of the verb.
Is this phenomenon found in other Romance languages?
How did this phenomenon originate?
How is the agreement of the participle in Old French?
This page seems to have some clues.
How is this phenomenon in Spanish and Italian?