The ability to store multiple images in a single GIF and specify how many milliseconds each image should display was always part of the format. That's how websites showed animated advertisements in the 90s before Macromedia introduced Flash. The ability to show animated GIFs in an infinite loop was introduced by Netscape Navigator 2.0 in the mid 90s.

Animated PNG support, on the other hand, is much less prevalent. MNG is rarely supported (and was officially discontinued by Mozilla in FireFox), while Mozilla's APNG was officially rejected by PNG's creators. No suitable animated GIF successor was ever made, so we're still using GIFs today.