The ha-ha is a bizarre architectural feature common in ornamental gardens: it’s a ditch that’s designed to be nearly invisible from one side. Presumably it gets its name from the garden-owner’s reaction when visitors stumble into the ditch.
In real life, ha-has are used to enclose livestock without breaking sight lines. In D&D, I presume that they’re a goblin invention. They’re named so because goblins find it so funny when human invaders fall into hidden pits.
In one game I ran, I gave the PCs a goblin-drawn map of a dungeon. The hidden pits were all marked as “ha-ha.” However, goblins find so many other things funny: sharpened pendulums, poisoned meat, patches of green slime on a green carpet: and they note them all with various onomatopoeia for laughter. On a goblin map, treat “ha-ha,” “har-har”, “hee-hee”, or “lol” as “find an alternate route.”
There’s a ha-ha at the San Francisco Zoo: as you approach the chimpanzee enclosure, there’s a shocking moment when you realize that there isn’t actually an enclosure. There’s just a low hedge and open air and a bunch of dangerously violent apes. It’s only as you get closer that you realize that the hedge is there to make the moat separating you from the chimps less conspicuous. (The chimp side of the moat is a climbable slope, so there’s no danger of chimps getting stuck down there.)
At any rate, this seems like a design applicable to D&D as well: put a too-high-level monster on something like the chimp island to create tension.
I see the wikipedia article you link to also talks about deer-leaps, a construction in which a wall surrounds lower ground, creating an enclosure that deer can leap into but not out of. Goblins probably make man-leaps.