As a developer who works very irregular hours, the reasonings are numerous, but all of them are valid:
Long commute times
Arriving later avoids major traffic jams. Example: Spending 30 minutes in traffic vs. 30 minutes at home then leaving later avoiding traffic jam means I can spend 30 minutes at home productively.
Poor office environment
Noise disrupts development work badly. Arriving later and staying later means you can catch a quiet period as people start to leave.
Lack of reasonable justification
Not attending on time is more beneficial, and most 'on time' arguments are 'because I said so'. I'd attend emergency meetings, but if it's more productive to be late or flexible, then I should be.
Developers already 'works' outside of hours
Managers might feel 'ripped off' by late arriving devs, but developers are still thinking of the problems and solving them outside of hours. In one case I came up with a solution in a dream at night - do I bill you the 8 hours? Being reciprocal in flexibility works both ways.
Majority of development work (for me) is mental
Externally, I might look like I'm procrastinating (videos, Stack Exchange, irregular hours, etc.), but I'm giving my brain fuel (external input) for creativity and keeping it in good condition (lowering stress).
Before writing any code you have to design it first. Any stressed mind is not going to work ('Ugh, they're still playing that awful music!').
It's no different to how I'd normally work (as a hobbyist)
Tackling my own development problems, I behave the same way. I don't force strict times, nor force myself to keep hammering away at a problem. Going away, destressing, and talking about it, gives me the room to think of solutions.
Externally, it looks unprofessional in a work environment. But it's always gotten me results.