Traditionally, they used to ride horses into pits and intentionally trip them. Needless to say, this often resulted in injured horses (and sometimes riders). Or they would use something called the "Running W" - again to trip the horse.
In the 1940s, things started to change. Modern stunt horses - "falling horses" are literally trained to go down on command. They normally soften the ground - which might not have been done on the sandy beach, as it was already soft). It's done using a special rein cue.
A trained falling horse is very valuable - not every horse has the combination of athleticism and willingness to do it.
Here's a video of a trick rider practicing the stunt so you can have a better idea how it's done.