A trie is a tree-based data structure used to store strings in a compact way. It supports efficient pattern matching and prefix matching queries. A trie stores strings by splitting them into individual characters and inserting them as paths in the tree from the root node downwards. Common prefixes are shared between strings in the trie rather than being repeated. Operations like insertion, deletion and searching of strings can be performed in time proportional to the length of the string.