PNG supports millions of colours, there’s a subset which has a limit of 256 colours should that be all you need. Historically, PNG was created as an alternative for GIF which was subject to patent licensing (now expired). It also supports animations, though to date, I don’t think anyone has seen an animated PNG.
PNG isn’t lossy, so data in = data out. JPEG is lossy, so data in != data out. The decompressed image is not identical to the original and there is detail and colour information lost. PNG loses out to JPEG as the latter can carry colour profiling data, while the former can’t. PNG also can have 256 level of grey scale masking, which is useful.