The pocket began during the Middle Ages as a detachable pouch worn inside the clothing.

Put This In Your Back Pocket... A Short History Of The Pocket

Source: Pounds To Pocket