Decompilation runs the compiler in reverse. A compiler turns source code that people write into machine code that computers run. A decompiler takes that machine code and tries to produce readable source again.
What you get back, and what you don't
Compiling throws information away. Variable names, comments, the structure of the original files and many of the programmer's choices disappear. So decompiled code is an approximation. It behaves like the original, but it often reads as a pile of generic names and tangled logic, and it may not be what the author actually typed.
A stricter goal is a matching decompilation: source code that, when built with the original compiler and settings, produces machine code identical to the shipped program, byte for byte. Hobbyists use this to rebuild old games and software. It is demanding, because you must find source that the compiler turns into exactly the same output.
How it is done
Tools called disassemblers show the machine instructions, and decompilers turn those into code in a language such as C or C++. People then work through the program function by function, renaming things, restoring structure and checking the result against the original. It is slow, skilled work.
Where AI fits
Reading unfamiliar code and proposing equivalent source is something AI agents can do at scale, and the task comes with a natural test: compile the candidate and compare it to the original. Builders who use agents for it generally rely on that automatic check instead of trusting the agent's own judgment of its work. That pattern, a pass-or-fail test the agent cannot change, is useful far beyond decompilation, and it sits inside the agent harness that runs the job.
Why it matters to you
Decompilation has legitimate uses: security research, recovering lost source, interoperability, preserving old software and studying malware. It also raises legal questions. Software licenses, copyright law and anti-circumvention rules vary by country and by situation, and many licenses forbid it. If you plan to decompile something, check the terms and get legal advice first.
If you ship compiled software, assume determined people can recover a rough version of your logic. Keep secrets such as keys and credentials out of the binary, and put sensitive logic on a server you control.
Decompilation differs from obfuscation, which deliberately scrambles code to make decompiling harder, and from reverse engineering in general, of which it is one technique.