A ha-ha is a landscape device to control animals and people, such that out of sight, out of mind is the order of the day.
Wikipedia’s Ha-ha entry is a great read! Once you get past the Simpson character Nelson, whose lexicon has little else but Ha! Ha! In it the reader will find a well-crafted contribution on the Ha-ha.
My contact with the Ha-ha is in a little book titled “Redesigning the American Law: A Search for Environmental Harmony” by K. Herbert Bormann, Diana Balmori and Gordon T. Geballe on page 16 a fierce looking sheep seems confounded by the below-ground fence! The book is published by Yale University. The illustration indicates a grassy “mote” on the sheep’s side and a wall of perhaps peat blocks.
My mind sees a pot bunker at the British Open. The green is where the golfer wants to be. The steep wall of the pot bunker stymies the aspirations of the golfer.