Generally speaking, the quality of a piece of hardware or software that allows it to perform in concert with an accepted standard, or in a manner akin to another piece of hardware or software.
In terms of hardware, compatibility refers to the ability of a piece of equipment to confrom to an accepted model. For example, an IBM-compatible computer by definition will behave virtually identically to an IBM PC, regardless of the manufacturer. Similarly, a Hayes-compatible modem will behave virtually identically to a modem manufactured by Hayes. Also in terms of hardware, compatibility also refers to the ability to add a piece of equipment (such as a keyboard, printer, etc.) to a system and have it function properly.
In terms of software, compatibility refers to the ability to read a file created by one program (or version of a program) using another program (or another version of the same program). This is rarely encountered; hence, the adoption of standard file formats by software developers has in large part rendered the idea of software compatibility moot. But not entirely.