I was always curious about this, but I never found the answer. Originally I only knew freestyle BMX bikes, but then found there are official races offroad. What is the idea behind this? Sounds like racing giro d'italia on downhill MTB.
BMX was originally (and still is) run on smooth dirt track that have obstacles such as jumps and whoops (also know as the rhythm sections). Because the tracks are smooth a small fully rigid bike works amazingly well when ridden appropriately. The BMX bike and track evolved together emphasizing a riding style that is about timing and body position. All of this took off in around the mid-70's just as Mountain biking was in its infancy with the Repack rides. The end result is that BMX bikes are really the optimal form factor for BMX tracks.
For example, whoops are a series of smooth small mounds that are typically part of a track's rhythm section. By pulling back and up on the bike as you approach the crest and pushing down on the downside you can actually gain speed through this section without pedalling. If you can continue pedalling while doing so you can gain even more speed. Some advanced riders may even jump some or all the whoops, others may manual or wheely through. The commonality, is controlling your center of gravity so that you body position changes as little as possible while moving the bike over the terrain.
Similarly jumps have smooth lead ups and transitions. Learning body position, timing and pumping are some of the techniques used to ensure you land smoothly on the transitions on the backside of each jump. Good riders will look like they never stop pedalling from when they leave to when they land on the transition. Advanced riders also do some other pretty impressive things such as rear wheel dabs mid-flight to help control their flight paths and where they will land.
Speed and smoothness is the goal in BMX dirt track racing. Because the tracks are so controlled, once the various skills are learnt a small rigid bike like a BMX bike is literally the fastest way around the track.
Starting in the 90's many BMX clubs started introducing MTB bike categories to encourage cross-overs. Having ridden both on the tracks, the smaller BMX bikes are faster. Things such as suspension are not needed. The tracks are smooth and jumps are landed on the transitions (hopefully!). Suspension just ends up just adding weight, and can interfere with techniques such as pumping the bike.
More than existing, BMX off road racing is actually an Olympic sport.
According to Olympic site on this sport:
Bicycle motocross (BMX) started in the late 1960s in California, around the time that motocross became a popular sport in the USA. The motorised version of the sport was the inspiration for the human-powered competition.
And had an international federation created in 1981:
In April 1981, the International BMX Federation was founded. BMX rapidly developed a unique sporting identity and it became evident that the sport had more in common with cycling than motorcycling. This was officially recognised in 1993 when BMX was fully integrated into the International Cycling Union (UCI). The sport made its Olympic debut at the 2008 Beijing Games.