Sometimes the character (or characters) can have been adventuring for some time before one adventure turned into story stuff, but sometimes they just have to have acquired experience in their lives first. Had their home town suffer an invasion of goblins, or a dragon. Stole as a member (however willing or unwilling) of a thief's guild. Even (ripping off a rule from 1st edition D&D) just have casting a spell grant experience so a wizard or cleric can leave the tower or church at a somewhat advanced level.
If the story takes a while, the backstory requirement and the main story may not conflict -- after all, the character can go up in level. And then, there's always the possibility of home-brews so the character gains some powers earlier or later. . . .