Although in your case the executable is not very large, it can become extremely large if you link everything statically. It also uses more memory since a large executable must be loaded into memory.
If you want to use a dynamic library, the operating system can “share” read-only memory between processes, which reduces memory requirements.
Updating your program can also be easier with a dynamic library, because instead of updating the entire executable, you can simply replace the dynamic library (provided that its interface is the same) and voila! The same thing happens if the user wants to update his dynamic library (for example, through the package manager).
source share