Wiki ArticleData packsDevelopmentStructures
Structure file
A structure file (also called structure template) is an NBT file that stores small structures of blocks and entities. Structure files are used to store some structures such as end cities, igloos, and fossils.
Structure files are stored as .nbt files in data packs in the  data/<namespace>/structure folder.
They can be saved and loaded using the Structure Block. When saved from Structure Blocks they are saved into the generated/<namespace>/structures subfolder in the world save folder. When no namespace is given, then the minecraft namespace is used.
Complete article available
This cached Wiki page is unusually large, so it is loaded on demand to keep the initial page fast.