means that
someone continues to pursue an issue or undertaking that no longer has a realistic prospect of success.
also
It is useless to flog a dead horse
Imagine a case where one is making an effort on something that there is no chance of succeeding; or spending time and energy on an activity that is already widely…; then “To flog a dead horse” fits well.