Let's look at the complete process of decoding a PNG file. Here's the image I'll be using to demonstrate:

Several letter 'S's on top of each other, each with a different color.

Chunking

PNG files are stored as a series of chunks. Each chunk has a 4 byte length, 4 byte name, the actual data, and a CRC. Most of the chunks contain metadata about the image, but the IDAT chunk contains the actual compressed image data. The capitalization of each letter of the chunk name determines how unexpected chunks should be handled:

UPPERCASElowercase
CriticalAncillary
PublicPrivate
ReservedReserved
Unsafe to copySafe to copy
c: Ancillary, H: Public, R: Reserved, M: Unsafe to copy

Here are the chunks in the image:

Show metadata chunks