My battery-powered wireless device draws about 50mA @ 5V. I’m thinking of powering this off a 12V 7Ah SLA battery that is topped up with a small solar panel (12V, maybe 500mA or so). 12V to 5V will happen with a DC-to-DC converter. Can I just connect a solar panel (with diode) straight onto my battery or is this where I need a charge controller? If the latter, what is the reasoning behind it?
It's recommendable to use a charge controller between the solar panel and the battery. The charge controller is there to avoid damaging your battery by overcharging. When a lead-acid battery gets charged above about 98%, oxygen and hydrogen bubbles form around the internal plates in the battery.
In a "maintenance-type" battery, this vents out and can be replaced, in an "SLA" battery it can cause irreperable "gassing," but in "AGM" and "gel"/"deep cycle" batteries, the bubbles stay tralped against the battery plates. These bubbles reduce the available current & capacity, while increasing the internal resistance of the battery.