~/.Xdefaults is the older method of storing X resources. This file is re-read every time a Xlib program is started. If X11 is used over the network, the file must be present on the same filesystem as the programs (for obvious reasons).
~/.Xresources is newer. It is loaded by xrdb, and its contents are cached in the XA_RESOURCE_MANAGER property of the X11 root window. Whenever any program looks up a resource, it is read straight from XA_RESOURCE_MANAGER. The advantage is that it's enough to call xrdb once and the resources will be available to any program running on this display, whether local or remote.
You can also have as many files as you want with whatever names you want (for example, some systems keep the name ~/.Xdefaults for compatibility), but you must reload them with xrdb every time you modify them.
If the root window doesn't have a XA_RESOURCE_MANAGER property, Xlib falls back to the old method of reading ~/.Xdefaults on every program start.
Most of the time though, your X11 startup scripts (xinitrc or xstartup) will call xrdb as early as possible. This means programs will not read ~/.Xdefaults every time you start them; only when you xrdb -merge the file.
Xlib Programming Manual P.441:
Prior to X11R2, X resource settings were read from .Xdefaults file
in users home directory and optionally on whatever machine the X client
was running on, so multiple files was hard to maintain.
Later on, xrdb program was made to store users resource settings from
in .Xresources into the XA_RESOURCE_MANAGER property of the root window
on the current X server, so all clients connected to the same server has
access to them. If the user hasn't called xrdb to set the property, then
.Xdefaults is read.
Wikipedia:
[...] the X resources are stored in two standard locations, depending on whether they apply to all screens or to a particular one:
- the RESOURCE_MANAGER property of the root window of screen 0
- the SCREEN_RESOURCES property of the root window of an arbitrary screen