This isn't addressed anywhere for creatures in general as far as I know, but it is addressed for two specific types: deities and dragons.
Originally Posted by D&DG p.29Obviously deities are a special case, so presumably the dragon figure is a better guide to RAI for other creatures. Having said that, true dragons often get better stuff than other monsters (most types get triple standard treasure for example) so this should maybe be considered the maximum rather than the average.Originally Posted by Drac p.24
You do get XP for activities other than fighting monsters, but in most cases it's much slower. Exactly how this works has never been spelled out as far as I know. Tbh, how the world works in the background is always a bit of a handwave, from the fact that an ecosystem couldn't support nearly as many giant monsters as a typical D&D world seems to have, to the completely nonsensical demographics rules in the DMG. Don't examine this too closely, as they say on TV Tropes.