If you're playing the NES or GBA/PSX version, then using certain abilities will raise the stats ascociated with them.
Example: Firion gets hit. He gains some HP experience. Firion gets hit and nearly dies. His HP experience goes up greatly since he needs it. He might also get some Defense experience.
Example 2: Firion uses Fire. His stats in Magic and his skill with Fire go up.

However, in the NES version, if you leveled up one stat another would LOSE experience.
Example: Firion is a really good attacker. Chances are his magic will keep going down.
Because of this, it is highly recommended that you choose a stat and stick with it.