Chests will show up on any ground surface with air, water, or snow above it. By default, there's about a 1/30 chance of one in each chunk of terrain (either above or below ground). Their contents are determined in much the same way dungeon chests are filled, and use the same loot table. (See the minetest_game documentation.)
Chests will summon monsters to defend them, if you're using the nmobs or mobs_redo mods. They also have a chance of poisoning you (if my status mod is in use), turning into a lit TNT block (if tnt is in use), or dropping you into a deep pit.
NOTE: This mod requires my status mod to poison anyone. It can be downloaded here: https://github.com/duane-r/status/archive/master.zip
The source is available on github.
Mod dependencies: default