It’s a characteristic of English that many words (not all) shift the accented syllable when they gain a prefix or suffix. Most (not all) native speakers shift the accent routinely and probably don’t even think about it, but it must be a pain to learn.
Someone into linguistics could probably tell us if it’s true mainly for Latin-based words, where Latin had its own similar rule about accenting the penultimate syllable. Remember that for some time Latin was seen as the model language, and there were attempts to force English to follow the model, especially in grammar, which is how we ended up with some odd rules that never did quite fit our evolving English.
Prefixed words like potent – omnipotent (and variants):
vocal – equivocal
syllable – polysyllabic
locution – interlocutor
Similar suffixed words:
transit – transition
locate – location (vacate – vacation, stagnate – stagnation, etc.)
equal – equality (mobile – mobility, able – ability, etc.)
miracle – miraculous
reptile – reptilian
victor – victorious
analog – analogy
Others like to shift accents when they go from noun to verb. Typically the noun has the accent on the first syllable, the verb on the second, although in many instances the distinction is being lost.
record
rebel
detail
permit (the noun PERmit is fast disappearing, but I still say it)
perfume
defect
As for why there isn’t more consistency, well, there are lots of good answers to that, but, as the saying goes in tech, it’s not a bug, it’s a feature.