It's a bit more complicated, but essentially when using at least a Ryzen CPU and Ryzen platform motherboard with dual rank ram configurations, 2x16GB allows for better overclocks than 4x8GB when using a daisy chain ram slot trace topology. Most motherboards use daisy chain topology, but there are also boards with T topology. T topology will lower the maximum overclock potential, but can allow for higher overclocks with all slots filled compared to daisy chain with all slots filled.
Dual rank 2x16 or 4x8GB should always be faster than 2x8GB with the same speed and timings on Ryzen motherboards. 2x16GB should allow for slightly better overclocks and tighter timings than 4x8GB with daisy chain topology.
Edit - I should also say that 2x8GB is usually only around 5-10fps slower than 2x16GB or 4x8GB in games that gain any benefit from dual rank configurations. Some games may gain as much 15-20fps, but that would usually be with already high fps.