This is what's called a "Sprachbund" feature: it's a trait shared by a bunch of languages in an area, even ones that aren't genetically related. In particular, this one is a feature of the "Standard Average European" Sprachbund, a group of languages centered in Western Europe, and it's one of the features that was originally used to define that Sprachbund in the first place!
The construction seems to have arisen back in Latin. In Classical Latin, past aoristic verbs ("I loved") and present perfective verbs ("I have loved") look exactly the same: both of those would be written amāvī. But it's a pretty useful distinction to be able to make! So in Vulgar Latin, a new construction arose, using the verb habēre ("to have"). It's thought that a phrase like habeō litterās scriptās "I have (written letters)" got reanalyzed into "I (have written) letters", with habēre no longer indicating that you're actually holding anything in your hands, just that an action's been completed in the past.
Vulgar Latin eventually evolved into French, Italian, Spanish, and all the other Romance languages, and brought this construction with it; habēre is the direct ancestor of French avoir, via a series of sound changes. And once various Romance languages and Germanic languages and others were all being spoken in the same area, this feature spread through the Sprachbund: people speaking Germanic languages started to use the same construction. English "have"/German haben/etc isn't actually at all related to Latin habēre, but they looked similar, so it was the obvious choice when adopting the construction into Germanic.
Nowadays, this feature is called the "have-perfective", and it shows up in all sorts of languages within the Standard Average European (SAE) Sprachbund. It's not at all universal, but can be a good way to determine if a language has been influenced by SAE or not!