Ambient declarations in TypeScript use the 'declare' keyword to inform the compiler about variables or types that exist outside the current file. This helps TypeScript check types without generating JavaScript code for those declarations. For example, 'declare const apiKey: string;' tells TypeScript that a variable named 'apiKey' of type string exists somewhere else. When the code uses 'apiKey', TypeScript trusts this information for type checking. However, no JavaScript code is created for the declaration itself. At runtime, the actual value must be provided externally, or the code will fail. This concept is useful when working with global variables or external libraries. The execution table shows that the compiler registers the variable type but skips code generation, and the console.log outputs the value at runtime. Beginners often wonder why 'declare' does not create code and what happens if the runtime value is missing. Remember, ambient declarations are only for the compiler's knowledge, not for defining values.