Beating a dead horse is an idiom or phrase that basically means that no matter what you say about something or what you do about something that there will be no outcome or no better outcome.
So you argue back and forth about something that one believes is correct and others believe is wrong then someone says you're beating a dead horse.
It means that the conversation should end now because you're not gonna win the conversation nor is anyone else gonna win the conversation because it's been argued back and forth before.
A dead horse feels no pain so you won't get an outcome from beating a dead horse.
It can also mean that no matter what you try to do to fix something that you'll never fix the thing you're trying to fix so in that case you'd be beating a dead horse.