Most headlamps come with several illumination settings. To get the most from my headlamp battery, I use the lowest illumination setting needed to get the job done. I use a Nitecore NU20, which gives me 6 hours at 220 lumen, which is perfect for night hiking. Around camp, I use the lowest setting, 1 lumen or 40 lumens. The NU20 has a rechargeable lithium battery and can be attached to a power bank to recharge the NU20 and power the NU20.
A problem with many headlamps is that the headlamp can accidentally turn on in a pack. The NU20’s power button physically locks out to prevent accidentally turning on. Some headlamps may have a lockout feature. Before I got the NU20, the Petal Tikka I used would often have a dead battery because it would turn on in my pack.