Different implementations of DEFLATE possibly... https://en.wikipedia.org/wiki/DEFLATE
Or different compression algorithms used...
Or both?
For a sanity check: open each file (original, GIMP png, and Krita png) in gimp and save as PPM (human readable) then diff the files... there should be no differences between them all.
If there are differences, then something has gone wrong somewhere since both gimp png and krita png should be exactly like the original. If there are no differences then nothing has gone wrong and the two programs must use different compression implementations so pick which ever is best (I guess Krita since its smaller?).
You can diff the bits (hex editor) ofcourse, to get a better idea of what is different between the compressed versions, but working back from that... erm... not me.
Both are open source so futher digging in the relvant code areas would yeild the correct reason for this. Personally have no idea, never been bothered to look at the source for gimp (Although I'm pretty sure it uses zlib)... not used krita at all.