Sometime around the American revolution, people discovered that if you folded a musket ball in a piece of greased cloth -- usually a small linen rag smeared with tallow -- it was much easier to ram it down the barrel of the gun.
The tighter the fit of the ball to the barrel, the more energy would translate directly from the powder to the forward motion of the ball, resulting in greater range and better aim. Before the use of the patch, shot was whacked firmly into the barrel using both a ramrod and a mallet; the use of the greased patch made this process much easier, in turn speeding up reloading and allowing for more rapid fire. During the early 1800s, many guns, including the famous British Baker rifle, were issued with greased patches, stored in the butt-trap or patch box, a small compartment built into the butt of the rifle.
In 1847 Claude-Étienne Minié invented the Minié ball, which solved the problem in more convenient way; the shot had a 'skirt' that would expand upon firing to press outwards against the sides of the barrel.