Yep. zlibs lossless compression's been around for years. Take what is eqivelant to bitmap data (unless interleaving), slice into max 32 k chunks (so programmers can rely on a static memory buffer which is more reliable and robust to program with - png is designed to be easy and usefull to both use and program with), compress each chunk , then wrap each chunk (obviously it'd be done one chunk at a time though) with info about it, then add in a header at the start (and palette is it uses 8-bit mode), and whatever other things such as transparent colour, gamma correction etc (or even this: programmers can add custom data to pngs that can be labelled such that other programs most propably know to ignore it, which is a great feature).
zip a bitmap and compare it to a png. They are practically the same size => Standard compression. You dont expect zips to cause loss in quality to bmps.. Also means that the time it takes to zip and unzip a png is more than the extra transfer time taken lol, so unless your really stingie, dont bother zipping pngs (unless they happen to have unusually large headers, or have palette data).