How can USB Type C be backward compatible with older USB standards, given that they have different number of pins?
This is a strange question. More pins is definitely better than less pins. At least you can leave some unconnected, and you can have full compatibility. Easy, right? 

More seriously, electrically the legacy ports and Type-C ports are well compatible, same +5V, same D+/D- signals, ans same SuperSpeed signals. Regarding mechanicals and pin number, just take a look at the Type-C connector pinout:

1

First, GND pins and VBUS pins are quadrupled. It takes 8 out of 24. which leaves 16.
Then, USB 2.0 pins are duplicated too. Same for SuperSpeed Tx and Rx pairs. This takes 12 wires. A cable to connect any legacy USB device has one set of these signal wires, but the connector on the Type-C device has two set of signals. So one can plug the connector either way, and they will make the right connection. The two new signals are CC - communication channel, and two are "secondary channels", which you may skip in most cases. 

To summarize more formally, the compatibility between old USB connectors and Type-C is acheived by offering a set of "legacy cable assemblies" for all legal permutation of connectors.