With reason, history and/or backstory.
I've played the country bumpkin reluctant wizard, the natural progression, the tainted bloodline awakened, the pact for power, the long line of wizarding tradition, the seeker of power (no pacts), the relic of a bygone era, the natural, the blessed one, the historian, and probably more that I'm forgetting.
They all have their charm, in different ways, in different settings. Only about half of them were actually focused casters, but our (house)rules allow for more leeway on builds* so some of the more general sorts wouldn't work as well "by the book".
I have never however, just played a caster who has no real backstory as to why and how they are able to wield magic. If it's started that way, it's entirely in character, there *is* a reason that both the GM and I know, we just don't necessarily have it come up, and the character may not necessarily know. I love high fantasy and the concept of casters, but part of my mind refuses to not build in some sort of rationale...too much scifi as a child, I expect.
*all builds, not just casters, generally the melees benefit more, but all of the classes get something out of it-mostly for variety's sake, since our rules allow suboptimal classes/PrCs to see more playtime.