The story
From Galatians 6:7 in the Bible (King James Version; spelling modernized): “Be not deceived, God is not mocked: for whatsoever a man soweth, that shall he also reap.”
Etymology from Wiktionary, CC BY-SA 4.0.
Today it means: To receive as a return or reward in the same measure as one's exertions or intentions, in a good or a bad sense; to receive justice or one's just deserts. Full definition →
From Galatians 6:7 in the Bible (King James Version; spelling modernized): “Be not deceived, God is not mocked: for whatsoever a man soweth, that shall he also reap.”
Etymology from Wiktionary, CC BY-SA 4.0.