Definition by Dictionary.com
to abstain from an impulse to say or do something (often followed by from):
Synonyms: abstain, avoid
Instance without a verb: I refrain from alcohol.
Instance with a verb: The future generation will reap the best results of civilisation by refraining from repeating mistakes of the past.
^it would be grammatically wrong if repeat is omitted, even though in both context it still make sense and mean same thing
PS: I know what is wrong and right, but I am looking for the constructive explanation behind this.