The purpose of this article is threefold: Firstly, we propose some enhancements to the existing definition of 6-functor formalisms. Secondly, we systematically study the category of kernels, which is a certain 2-category attached to every 6-functor formalism. It provides powerful new insights into the internal structure of the 6-functor formalism and allows to abstractly define important finiteness conditions, recovering well-known examples from the literature. Finally, we apply our methods to the theory of smooth representations of
p-adic Lie groups and, as an application, construct a canonical anti-involution on derived Hecke algebras generalizing results of Schneider--Sorensen. In an appendix we provide the necessary background on
∞-categories, higher algebra, enriched
∞-categories and
(∞,2)-categories. Among others we prove several new results on adjunctions in an
(∞,2)-category and in particular show that passing to the adjoint morphism is a functorial operation.