Dirt bikes are accustomed to being beaten like old rugs. They're thrown off mountains, sent off jumps and whoops, plow through streams and rivers, and generally put through the wringer because, well, that's what they're designed to do.
And to do all that and walk away without breaking, the engineers at dirt bike companies spend an inordinate amount of time designing and engineering these off-road motorcycles so that when you do "Send it!", the whole thing doesn't collapse in on itself or fold like a paper crane. I mean, you wouldn't want to be sitting on one if and when the front wheel tried to meet the back wheel, right?
That's also why engineers tend to use materials like aluminum, steel, or carbon fiber for a dirt bike's frame, as these metals are less likely to cause serious structural integrity issues when you go off and dirt bike to your heart's content along the Trans Continental Trail or any number of Backcountry Discovery Routes areas.