Your Defence level rises whenever you train any of the combat-related skills, not only Defence itself.
That list includes Attack, Strength, Defence, Prayer, Summoning, Ranged, Constitution and Magic. So even with Ranged as your highest combat stat, working on any of the others still nudges your combat level upward.