Why it holds
Write both numbers as products of primes. The greatest common divisor takes each prime to the lower of its two powers and the least common multiple to the higher, and the lower plus the higher is the two powers added. So gcd times lcm has every prime to the power it has in a · b. With 84 = 2² · 3 · 7 and 36 = 2² · 3²: gcd = 12, lcm = 252, and 12 · 252 = 3 024 = 84 · 36.
Using it
Once the gcd is known, the lcm needs no factorising: lcm(a, b) = a · b / gcd(a, b). Euclid’s algorithm gives the gcd in a few lines even for large numbers, and this is then the quickest way to the common denominator of two fractions when the numbers are too big to list multiples of.