There are times G‑d will put a soul in prison—often a very lofty soul, such as Joseph.

It is like being held in a vise. Squeezed with the ultimate of futility, the deepest powers of the soul break through.

Likutei Sichot vol. 23, pp. 163–165; Shlach 5732:1.