The author attempts to give a comprehensive discussion of studies performed with the positive-muon spin rotation and relaxation technique (also known as the SR technique) on heavy-fermion compounds. The subtle competition between the demagnetizing Kondo interaction and the intersite Ruderman-Kittel-Kasuya-Yosida exchange interaction is believed to be the primary ingredient for the wealth of different ground states observed for this class of rare-earth-and actinide-containing intermetallic compounds. Due to its microscopic character, its sensitivity to extremely small internal fields, and its capacity to detect spatially inhomogeneous magnetic features, the SR technique has been extensively utilized to investigate the peculiar magnetic properties of these ground states and improve our knowledge of heavy-fermion phenomena. In addition to providing a short introduction to SR, where the intrinsic difficulties of the method are clearly stated, this article reviews the main results obtained by this technique on the best-known heavy-fermion compounds (superconductors, band magnets, local-moment magnets, non-Fermi-liquid systems, and Kondo insulators). Special emphasis is placed on the particular information obtainable by monitoring the implanted muon. [S0034-6861(97)00104-9] CONTENTS I. Introduction 1119 A. Puzzle of heavy-fermion physics 1119 B. Tentative classification of heavy-fermion systems 1120 C. Advantages of the SR technique in studying heavy-fermion compounds 1122 D. Organization of the review 1123 II. Overview of the SR Technique 1123 A. Muon production 1124 B. Principle of SR 1124 C. The SR transverse-field (TF) technique