When a metal object is heated, it increases in size and when the hot metal object is cooled, it decreases in size and comes back to its original size.
Therefore, on immersing the pickle bottle in hot water, the metal cap expands in size hence it can be removed easily.