For example, when you run a program owned by root, as most Linux binaries are, the program has the same kind of access rights that you have. It does not have root access to everything on the system. While running, these programs act as if they were being run by the owner of the program, regardless of who is actually running the program. Normally only root can change from one user to another. But because the su binary is owned by root and is setuid, su has all the privileges that root does, regardless of the user running the program.
Shared libraries are commonly used libraries of code that other programs can load dynamically.
Because the library code is stored separately, programs that use shared libraries have smaller binaries. Another cool feature of shared libraries is that you can use them to update a large number of programs in one fell swoop by updating a single shared-library file. The process of combining different pieces of a compiled program to form a runable binary is known as linking. Statically linked programs link all of the relevant pieces of code as the final stage of the compilation process. This results in a completely self-contained binary that does not use any shared libraries.