I remember learning in school that the gift horse expression came from the story of the Trojan Horse, a “gift” that brought down the fortified city of Troy.
The Greek Army wasn’t having any luck breaking into Troy, so a giant wooden horse was built as a gift to Troy and wheeled inside the city’s gates. But the belly of the beast was filled with soldiers who, once inside, slipped out and sacked Troy.
(actually, a better expression from that story would be “always look a gift horse in the mouth” to see what motives might be hidden inside)