Is there any reason given to why characters in D&D get experience points and level up? Is there a background reason given in any of the campaign worlds or rules anywhere?
Is there any description of what actions are actually worth of experience apart from the adventuring characters overcoming threats, story goals, etc.?
For example, that 5th level expert Smith, can we assume there was 5th level experience of story goals in the Smith's life or did the Smith get it from a 5th level worth of production of horseshoes?
To be clearer - I am not asking if XP is canon to D&D or how much your character should get. I am asking if there is a background reason that this character improvement happens. I understand it is a game and this is a game mechanic, that is not the question. There are lots of places in the class tree where characters just get better at stuff or gain 'gifts' like abilities. Is there a reason this happens or is it just campaign fluff and up to the DM?