Packages with pins allow for safe storage and manual montage of the ICs, as well as for a relatively easy way to replace them in devices. The packaging might have built-in solutions to cool the structure. But sometimes the chips are mounted the way you describe.
You sometimes might see one or more black blob-like objects on some devices' PCBs. These are bare silicon dies, connected to the PCB traces using thin wires, and then sealed using black compound. The downside of this method is basically lack of a way to repair if the IC gets faulty, applying sufficient cooling might be harder too. Storing bare silicon dies is also problematic.