In a static QR code the data is baked into the image itself. It works offline, never expires and depends on no server. But you cannot change what it contains, and you cannot count scans.
A dynamic QR code points at a short link. Whoever scans it goes to that link first, then on to the destination. Because of that extra step you can change the destination whenever you like, and see how many people scanned it, from where and on what device.
Use static codes for things that will not change, such as contact details or a Wi-Fi password. Use dynamic codes for campaigns, menus, posters and packaging — anything that might need updating.