As far as I understand they are libraries, but what is the difference between the two?
As a follow on, a .a file is an "ar" archive. Not unlike a tar archive, it stores .o or object files, allowing them to be pulled out of the archive, and linked into a program, among other things. You could use ar to store other files if you wanted.
You can get a listing of the members of an ar file with the -t parameter, for instance:
A .so file is a "shared object" file, and has a lot more information available to the linker so that members can be linked in to a loading program as rapidly as possible.
For instance, try:
(or whatever version of libc.so you have in your /lib directory.) Note that a .so file could also just contain a linker script directing it to find the file elsewhere, or use something else.
Interestingly, a .so file can also be a full fledged program. For instance, trying running /lib/libc.so.6.