meaning
To resist or rebel against a stronger force or an unavoidable reality, only to make your own situation worse; to struggle uselessly against something that cannot be changed, causing yourself more pain than anyone else.
Origin
The expression comes from the ox-goad, a pointed stick used to drive oxen. If an ox kicked against the sharp goad, it would only injure itself. Closest equivalents Don't fight a losing battle. Don't beat your head against a brick wall. You can't fight City Hall. (American idiom)