See Window.setIconImages(List)
. Depending on the platform capabilities one of several images of different dimensions might be used as the window's icon. There is an example on the File Browser GUI thread. This image shows the small icon used for the GUI, the larger one is seen when alt-tabbing between windows.

If the image is not square, Windows will pad it.
Java Web Start provides similar options for multiple sizes of icon for use in desktop shortcuts & menu items.
Re: images named:
fb-icon-16x16.png

fb-icon-32x32.png

..it doesn't matter on file names or anything - windows just picks the icons based on the image size?
Yes, the file names were chosen to include the size information for the benefit of developers. We might call the images:
icon-small.png
icon-medium.png
.. and it will work the same. The JRE will base the choice on the actual size of the image as measured once loaded. However I highly recommend adding something like -16x16
to a icon image names to make it explicit. The size of 'a small icon' changes over time & across devices.
what happens when you don't provide multiple sizes?
The JRE or system will scale the one image according to an algorithm that is not within the control of the developer. For example as above.
If the image is not rectangular, Windows will pad it.
I have a DukeBox player that attempts to pick up track or album art that applies to the track that is playing. It not only displays the image over the top of the sound trace, but also sets it as the (single) frame icon. Windows (at least) will scale to size, and pad with transparency for any non-square image. Windows even handles a PNG with partial transparency with aplomb.
OTOH, AFAIU OS X does not display frame icons. By design decision. I do not know if that results in the icon not appearing at all. You'd need the advice of a Mac. guru for better info. on that.
Since systems make their own (not necessarily optimal) decisions on how to scale icons, it is best to take as few chances as possible, & attempt to provide the right sized icon(s) for each platform. You're in luck if they have a common size or 3.
See also: the Sizes of frame icons used in Swing Q&A.
