Origin of “Beating a dead horse”

The origin of beating a dead horse. Was this ever a common practice suitable for a specific purpose? Is it related to the desire to spur a horse into action?


The origin of the idiom is the following:

According to Etymology Online:

'A dead horse as a figure for something that has ceased to be useful is from 1630s;

to  flog a dead horse

''attempt to revive interest in a worn-out topic" is from 1864.'

According to Merriam-Webster's Dictionary https://www.merriam-webster.com/dictionary/flog:

flog

transitive verb

1a: to beat with or as if with a rod or whip

// The sailors were flogged for attempting a mutiny.

Here's an example from Reverso.context.net:

Anyway, not to beat a dead horse, but just to be super clear, I was looking for the key out front, and I thought maybe it was on the side.