Know how to use "fewer" and "less"? Find out.
1837, slang, something that "settles" a debate, discussion, conflict, etc.; hence "something astonishing" (1880s). Probably an agent noun from cork (v.) on the notion is of putting a cork in a bottle as an act of finality.