ESP8266 Wlan disconnects - Step down converter or capacitor?

If I connect the ESP8266 via usb to a computer, the wlan is
very stable. But if the ESP8266 gets the power from a battery,
there are wlan disconnects every 5 or 20 seconds.

In order to stabilize the power supply, do I need a capacitor or would
a step down converter like the XL4015 DC also be suitable?

The battery that you are using is a?

It's a 48V 16Ah DeHawk akku where the ESP8266 is connected to the 5V line.

Surely not, as the poor esp8266 would be instantly fried if you connected a 48v battery to the 5v line...

That you're asking why it disconnects, not why it is on fire, indicates that there is already a step down converter with 5v output involved somehow. Post link to that so we can assess whether it is likely to be the problem.

The ESP8266 is connected to the 5V line of the akku.
The akku can provide power with different voltages to different components and devices.

The question is, can the XL4015 DC step down converter also solve problems with voltage fluctuations or spikes like a capacitor can do?

Or differently asked, if the ESP8266 pulls too much power out of the 5V line with a active
wlan connection, could a XL4015 solve the problem or is a capacitor needed?