This question already has an answer here:
If USB 3 is backwards compatible, why do they place USB 2 ports with USB 3 ports on motherboards?
Also, do USB3 External drives not work with USB2 ports?
USB 3.0 is fully cross compatible.
USB 3.0 devices will run at 2.0 speed when hooked into a USB 2.0 port.
USB 2.0 devices will run at 2.0 speed when hooked into a USB 3.0 port.
The USB A connectors for 3.0 have a second set of contacts that will not touch anything when plugged into a mating 2.0 termination. USB A connectors are typically used on the computer chassis. Any A plug will plug into any other A socket.
The USB 2.0 cable is the universal cable that should work with anything. USB 2.0 cables will plug into USB 3.0 peripherals, but USB 3.0 cables can't be used with USB 2.0 peripherals.
The B and mini USB 3.0 plug ends are structured such that they will not plug into USB 2.0 sockets, conversely, the B and mini USB 2.0 plug ends are a subset of the 3.0 connector and so will easily plug into a USB 3.0 peripheral socket.
USB 2.0 is older technology, there are still a lot of devices out there (who needs 3.0 for a keyboard or mouse?) and the 2.0 support chipsets are cheaper so you will see a mix for some time yet.
Most USB 3.0 based external drives will probably need a special driver (especially Western Digital) installed before the drive is fully usable on either connection setup. They work on both speeds of port, you just have much slower access on a USB 2.0 port.
USB 2.0 and 3.0 ports are both placed on motherboards because the ports are on different controllers. One of the controllers is included in or with the motherboard chipset the other is added by the OEM. In either case the motherboard manufacturer (OEM) is trying to maximize the number of accessible root hubs.
If you place a high bandwidth device on the same root hub as a low bandwidth device you get decreased throughput. Especially when the devices are different USB versions. The USB design sets line speed at the root hub, not at the device. USB 3.0 overcomes this somewhat by allowing device "unlocking" of unsynced devices, but there remains an, albiet reduced, performance penalty. This is why its better that high-bandwidth devices like pen drives, external hard disks, video cameras, and USB network controllers go in a port directly on the motherboard instead of daisy chained.
As to why the ports aren't all USB 3.0; that's because either the USB controller in the chipset is 2.0 so the OEM can't change it, or there was a significant price difference to add a USB 2.0 controller isntead of a 3.0 one.
They place USB 2.0 ports on a motherboard with USB 3.0 ports because USB 2.0 ports are cheaper, not everything requires a USB 3.0 connection's speed, and everyone hates to run out of USB ports.
Of course it's backwards compatible!
If it wasn't, then your (USB2.0) mouse wouldn't work when you plugged it into a USB3.0 port. Or a fancy new USB3.0 flash drive wouldn't work in any of the old USB2.0 ports (which account for the vast majority of USB ports out there still).
Can you imagine buying a USB3.0 flash drive and not being able to use it in most USB ports? There would be an outcry.
So yes, it is backwards compatible, just as USB2.0 is with USB1.1.
USB3.0 chips are considerably more expensive. If it weren't for price, then manufacturers would just go and make every USB port USB3.0 (as they are compatible, then there would be no disadvantage, so it would just be a great boon for the marketing guys: "ALL PORTS ARE USB3.0!").