This doesn't sound right to me. When my D300 fills the card, the camera won't take any more photos. I don't think there's any way the camera would overwrite photos that are already on the card.
Here are two hypotheses on what might have happened:
1. You thought your card was almost full, but you reformatted it, or downloaded photos to your computer, so even though you thought there were photos on the card, there really were no photos there.
2. The camera numbers photos sequentially, starting with 0001 and goes up to 9999. When it hits 9999 it creates a new directory on the card and starts with 0001 in the new directory. So, maybe that happened to you and you didn't notice that the old photos were still there, but in a different directory.