- How does 1 button generates 4 states (from my point of view it should be on/off)?
The chip under the black epoxy "bubble" has an oscillator and a state machine that implements this functionality.
- Could somebody explain me as to a child how the board works?
All of the functionality is inside the chip, so "explaining" how it works would amount to designing something similar to what's on the chip. It's not a very complex chip, and could be easily put together in either a bipolar or a CMOS process, or assembled from discrete transistors (either BJT or MOS).
It's just as likely though that instead of an ASIC it's just a very simple microcontroller. Then, "explaining" would amount to writing a little bit of C or assembly code to provide the same behavior.
To "fix" the board you could remove the original chip (scrape it off), buy a 6-pin microcontroller, load it with code that does what you described, solder it down, and you'd end up with the same functionality.
- How to diagnose why it might not work (the root of the question) – so the LED stopped flashing?
Most likely mechanical stress caused a bonding wire to rip off the chip or off the board. This is a very low cost design, and is not particularly sturdy. The cheap PCB substrate bends a lot as the button is operated, and this is not mechanically compatible with relatively rigid epoxy and chip die. Something is apt to get damaged sooner rather than later.
If you had means to dissolve the epoxy away, I bet you'd find a disconnected/broken bonding wire - one or more out of several that connect the chip die to the PCB traces. If you then had access to a wire bonding machine, you could re-make the connection, assuming that the chip wasn't damaged.
There is also some possibility of electrical damage due to static electricity or batteries inserted with reverse polarity.
In any case, any effort spent on "fixing" it is worth orders of magnitude more than the device itself. The cheapest "fix" is to get a new one, unless you want to learn a lot about fairly intricate engineering.
To actually fix it, you'd need to learn the basics of chip de-encapsulation (using rather strong chemicals that require lots of care in their use), chip bonding, microscope technique and recognition of chip structures needed to assess the current state of the chip and its connections, etc. Then, if the chip itself was damaged, you could scavenge a chip die from another one of those flashers, attach it to the PCB, and bond it. It takes little time in a well equipped microelectronics prototyping lab, or a lot of time and effort if you'd want to collect 2nd hand tools needed to do it all. You'd also need plenty of practice on working flashers before attempting to fix a broken one. You'd break many in the learning process, too.
Ultimately, whether it's "fixable" is entirely upon what tools you have access to or can put together, how much you're willing to learn, and how much money you have to pay for all that.
If your only goal is to "fix" the thing: buy a new one. It'll be infinitely cheaper than fixing it.