CP/M is an acronym for Control Program/Monitor (or Control Program/Microcomputer) and was an early operating system for Intel 8080 and Zilog Z80 based computers. It was created by Digital Research Corporation established by Gary Kildall.
It was normally distributed in its raw form on 8 inch floppy disks. CP/M could be implemented on most new 8080 and z80 based systems by writing an interface layer, called the BDOS, for your particular computer then using the largely generic rest of the operating system largely unchanged. It was thus fairly portable amongst different machines with the same CPU; this made it popular, and much more software was written for CP/M than for operating systems that only ran on one brand of hardware. Hundreds of different brands of machines ran CP/M.
Later a version of CP/M for the Intel 8086 (CP/M-86) was written; it was an alternative to MS-DOS for IBM PC's. CP/M-86 never gained much popularity after IBM licensed MS-DOS instead and sold MS-DOS as the "official" operating system of the PC.
CP/M was the predecessor of MS-DOS. Many of the basic concepts and internal mechanisms of early versions of MS-DOS were clearly copied from those of CP/M. CP/M used the "drive letter" concept (A:, B:, C:). Internals like file-handling data structures were identical. This was done on purpose, to make it easy to port popular CP/M software like WordStar and dBase.
The user interface of MS-DOS however was a bit more friendly. Compare for example CP/M's copy command.
PIP <destination filename> <source filename>
to DOS's more intuitive
COPY <source filename> <destination filename>
See also: MP/M