I would say that as a "rule of thumb", when two expressions are so similar, they have a common "ancestor" in Latin, but it might be impossible to assure for all cases.
In other cases, the meaning might be quite plain simple and literal. Take for example the famous
"Not all that glitters is gold", which is attributed to Shakespeare's The Merchant of Venice (believed to have been written between 1596 and 1599). The expression
"No es oro todo lo que reluce" appears in chapter XXXI of Cervantes' "El ingenioso hidalgo Don Quijote de la Mancha" (published in 1605, so people claim that Shakespeare's coined this expression and others just copied/reused it), but in La Celestina (published in 1499) we find the very similar
"En la tina, todo lo blanco no es harina" 1. Which highlight that this expression (or a similar one) is quite popular and common in most modern languages.
In a similar way compare:
- don't look a gift horse in the mouth
- a caballo regalado no se le mira el diente
Looking at a horse's teeth is the best way of knowing if they are healthy. That's why the sayings are so similar. The root of the meaning is literal but now it gets used for other contexts. Other examples:
Sometimes sayings and proverbs might differ in wording, but meaning is the same
If you run after two hares you will catch neither (Quien mucho abarca, poco aprieta)
Better the devil you know than the devil you don’t know (más vale malo conocido que bueno por conocer)
If it is an expression/coloquialism (a sentence that doesn't mean the literal meaning of it's words) then you might need to go case by case. I don't think that there is a "one size fits all" solution/explanation for this, and even if we assumed one of the hypothesis (either "it comes from common ancestor", "meaning is quite literal" or "Language A influenced language B") there would be plenty of exceptions.
1- CVC: No es oro todo lo que reluce
2- 25 refranes en diferentes idomas (article in Spanish)