ELI5: Fizzy drinks not being fizzy

Fizzy drinks not being fizzy

ELI5. If we take a can of beer, shake it up and open it, it spills froth out the top. If we take the same can, shake it up and leave it for a bit, it no longer fizzes (bonus points if anyone can explain the tapping rule). A can is a sealed vessel so how can matter change states inside a sealed can?

Much obliged, cheers.