Reverse Engineering
In short: Reverse engineering examines a finished program or device to understand how it works.
In more detail: You only have the result (for example an executable file) and reconstruct its logic and structure from it.
In Depth
Tools
Disassemblers and decompilers (Ghidra, IDA), debuggers, network capture. See assembly.
Use
Analysis of malware, checking for vulnerabilities, compatibility, recovery of lost code.
Law
In Germany § 69e UrhG permits decompilation under narrow conditions (interoperability). Licence terms may forbid more.
See also: Malware, Assembly, Forensics, Penetration Testing