The Excalibur problem is that, over time, people have combined two different Arthurian swords into a single blade. This is a serious pet-peeve of mine.
- Sword # 1: "Clarent", the sword in the stone. It was used in Ceremonies (e.g. the dubbing of knights). This sword designates Arthur as being rightful heir of Uthur.
- Sword # 2: "Excalibur/Caliburn", given to Arthur by the Lady of the Lake, and Arthur's sword for battle. This sword grants the divine right to rule England.
Most popular depictions (especially in recent years) tend just to use one sword or the other and call it Excalibur. However, some find a way of placing the sword in the position of both: e.g. the Lady of the Lake puts it into the stone, or something to that effect.
Older texts, however, do make the distinction clear even if it's a "blink and you miss it" moment. For example, a sentence saying that the sword in the stone was fragile, and couldn't be used for combat, so Arthur went to the Lady of the Lake for a new one.
In the medieval "Alliterative Morte d'Arthur" the roles of Arthur having the two swords is actually really important: Part of Mordred's coup involves stealing Clarent (establishing that he has the mortal right to rule by laws of men) in addition to kidnapping/"marrying" the queen. The final battle involves Arthur, wielding Excalibur (divine right to rule), versus Mordred, wielding Clarent. The two then destroy each other.
I really hope this helped clear things up for you. I'd recommend starting with Geoffrey of Monmouth and working your way through medieval texts to see the evolution of the depiction of Arthur's swords.