As part of the Unified Community Platform project, this wiki and 38 others will be migrated to the new platform in the next few weeks. Minimal changes are expected as part of this migration. Read more here.
Chests, a vanilla feature, are added to World Gen by Deadly World. These can spawn anywhere below layer 62, but have the best loot between layers 28-20. Chests have a high chance of being Trapped Chests, but that chance, along with the rarity of these chests, can be changed in the config file.