In the last few years, there has been enormous progress on the statistical description of the entropy of BPS black holes in AdS$_D$ for $D>3$ in terms of states in the dual field theory. The success of such developments relies on the existence of an extremisation principle in the bulk which maps to the evaluation of the partition function in the field theory in the large charge limit. I will describe an ''off-shell'' approach to the study of black hole thermodynamics in AdS$_5$ based on an effective superpotential. This approach offers a powerful tool to analyse the thermodynamics without resorting to explicit solutions and can be in principle implemented even to non-supersymmetric configurations. For BPS black holes, it provides the framework where the aforementioned (Hosseini-Hristov-Zaffaroni) extremisation principle emerges naturally in the bulk while it also reproduces Sen’s entropy function for near extremal black holes.