What is an ICO file?
An .ico file is a container. It holds several copies of the same icon at different sizes, and whatever displays it picks the one that fits.
favicon.ico
Each copy inside is a complete image, stored as PNG or as an uncompressed bitmap (BMP). A browser tab draws 16 or 32 pixels, Windows wants 32 and 48 for shortcuts and up to 256 for large tiles. One file covers all of them, so nothing is shrunk on the fly.
Typical sizes are 16×16, 32×32, and 48×48. Many files add 64, 128, or 256.
Which sizes should I include?
16, 32, and 48 cover tabs, bookmarks, and the Windows taskbar. Add 256 if the icon also ends up on a Windows desktop or in a pinned site. Every extra size adds bytes, so skip the ones nothing asks for.
How does a browser choose?
It reads the list of sizes at the start of the file and takes the closest match for the space it is drawing, allowing for screen density: a 16px tab on a 2× display uses the 32. If nothing matches exactly, it scales the nearest one.
PNG or BMP inside?
Both are valid and every browser reads both. BMP is the classic format for the small sizes; PNG is compressed and is the norm at 256×256, where a bitmap would be about 260KB.
Is a renamed PNG an ICO?
No. Changing the extension does not add sizes; the file still holds one image. The ICO splitter shows what a file really contains.
Starting from one logo? The favicon generator builds favicon.ico with the rest of the icon set. More on formats: ICO vs PNG.