The QFN is a leadless, quad flat pack, integrated circuit package. It is very small and is more convenient to use than a micro BGA.
Micro BGAs that have a pitch of 0.5mm or smaller are both costly and less convenient to use because they have double rows of pins. With this type of package layout, escape routing can utilize plated or plugged vias, which makes the board layout more difficult, hence, more expensive to manufacture.
QFNs are about the same size as micro BGAs but have exposed pins that are around the perimeter of the package. Hence, they do not require escape routing.
It is critical to remember that even though QFPs and QFNs use the same letters (i.e. Q and F) one cannot be replaced with the other. Now, sometimes, PCBs use both types of component types.
Both QFPs and QFNs are used because the Atmega32U4 used in the Leonardo at times cannot be purchased due to limited supply availability. Hence, both types give you more flexibility that won’t need PCB design changes at a later date. You may want to consider this if the PCB has enough room for a QFP or you are concerned about part availability. If you are, here are some things to think about:
Ensure all the pin-outs have a one-to-one correspondence. At times there will be differences or extra pins.
To avoid noise problems make sure your PCB has enough space. In general, bypass capacitors should be placed very close to supply pins. For the most part, this isn’t a problem for QFNs. But, in rare instances, it will.
Verify that the unsoldered pads will not pose problems. Harsh environments can affect these pads to cause problems. If this is a problem, you should apply a conformal coat to the board.