License compatibility is a legal framework that allows for pieces of software with different software licenses to be distributed together. The need for such a framework arises because the different licenses can contain contradictory requirements, rendering it impossible to legally combine source code from separately-licensed software in order to create and publish a new program.
License compatibility can be defined around the concepts of "collective/combined/aggregated work" and "derivative work". The first "collective work" license compatibility definition allows the usage of variously-licensed works in a combined context:
the characteristic of two (or more) licenses according to which the codes distributed under these licenses may be put together in order to create a bigger distributable software. [emphasis added]
A stronger definition includes the capability to change the license. The most prominent example is the copyleft license's demand that the "derived work" combined from code under various licenses as whole is applied to the copyleft license.
License compatibility: The characteristic of a license according to which the code distributed under this license may be integrated into a bigger software that will be distributed under another license. [emphasis added]
A combined work consists of multiple differently-licensed parts (avoiding relicensing). To achieve a combined work including copyleft licensed components (which have a viral property leading potentially to a derived work), proper isolation/separation needs to be maintained.
With individually licensed source code files, multiple non-reciprocal licenses (such as permissive licenses or own proprietary code) can be separated, while the combined compiled program could be re-licensed (but that is not required). Such source-code file separation is too weak for copyleft/reciprocal licenses (such as the GPL), as they then require the complete work to be re-licensed under the reciprocal license as being derivative.
A slightly stronger approach is to have separation at the linking stage with binary object code (static linking), where all the components of the resulting program are part of the same process and address space. This satisfies "weak copyleft/standard reciprocal" combined works (such as LGPL licensed ones), but not "strong copyleft/strong reciprocal" combined works. While it is commonly accepted that linking (static and even dynamic linking) constitutes a derivative of a strong copyleft'd work, there are alternate interpretations.