Coup means a blow or strike, from French coup, which descends through Old French colp from Late Latin colpus, an altered form of Latin colaphus. The Latin word was borrowed from Greek kolaphos, meaning a slap or punch. The physical violence of the original word persists in the political term coup d'etat, literally a blow to the state — a sudden strike that topples a government.
French uses coup in dozens of compound expressions. Coup de grace (the mercy blow), coup de theatre (a dramatic surprise), coup de foudre (a lightning strike, meaning love at first sight), and coup de maitre (a master stroke) all build on the same base word. English has borrowed several of these directly, along with coupe (a type of car, originally a cut-down carriage — a different French coup meaning a cut) and coupon (a piece cut off).
The political sense crystallized in 18th-century French political writing, though the practice of sudden government seizure is as old as government itself. Napoleon's coup of 18 Brumaire in 1799, when he overthrew the French Directory and installed himself as First Consul, became one of the defining examples of the term in action.
English adopted coup d'etat in the 18th century and began shortening it to simply coup by the 19th century. The abbreviated form has since developed its own secondary meaning: any especially clever or successful maneuver in business, sports, or personal affairs. A company making a key hire might be said to have pulled off a coup, with no political violence implied.
Spanish golpe and Portuguese golpe derive from the same Latin root through regular Iberian sound changes that turned initial Latin c- into g-. Golpe de estado is the exact structural equivalent of coup d'etat, preserving the same blow-to-the-state metaphor in a word that has mutated beyond easy recognition from its French cousin.