"Lenacapavir works by binding directly to the interface between HIV-1 viral capsid protein (p24) subunits in capsid hexamers, interfering with essential steps of viral replication, including capsid-mediated nuclear uptake of HIV-1 proviral DNA, virus assembly and release, production of capsid protein subunits, and capsid core formation[1]... It functions by binding to the hydrophobic pocket formed by two neighboring protein subunits in the capsid shell. This bond stabilizes the capsid structure and inhibits the functional disassembly of the capsid in infected cells.[2]"
In other words, it prevents the virus' protein shell (capsid) from being built properly, which in turn prevents the virus from properly opening ("uncoating") once it enters a host cell.