As you inhale, your heart rate slightly increases, and as you exhale, it slightly decreases. This phenomenon is known as respiratory sinus arrhythmia (RSA).
Garmin watches measure respiration rate, which is the number of breaths you take per minute, using the optical heart rate sensor. The watch analyzes heart rate variability (HRV) to determine breathing patterns. Essentially, it detects subtle changes in your heart rate that correspond to inhaling and exhaling.