The English foot comes from the Indo-European root *ped. Think pedal.
Interestingly, the “p” sound consistently transformed into an “f” in the Germanic languages — but remained a “p” in the Latinate languages.
This is why, foot is equivalent to pie.
Other examples of this pattern include father and padre, and the English far is from the same root as the Latin per.
The Spanish pegar (“to paste”) comes from the Latin pix, meaning “tar.” That makes sense: “paste” looks like just a more diluated “tar.”
But pix itself comes from the Proto-Indo-European root pei(e), which meant, fat — think of animal fat, for example. It makes sense that this word evolved into a word meaning “tar”: that’s a bit what animal fat looks like.
From this same root pei(e), we get a few notable English words:
It is both surprising and funny that in Spanish, a Flea Market is translated to be, literally, exactly the same: Mercado de Pulgas.
But it is even more surprising (although probably less funny) that flea and its Spanish translation, pulga, are close cousins – despite the different sounds.
Both derive from the Indo-European *plou. To understand this transformation, we should remember that the Indo-European p- sounds stayed the same in Latin (and thus Spanish) but became an f- sound in German (and thus English).
Therefore, the f-l of flea maps exactly to the p-l of pulga!