Wikipedia states that:
In some ancient synagogues, such as the fifth-century synagogue in Susia, the Torah scroll was not placed inside the synagogue at all, but in a room adjacent to it, signifying that the sacredness of the synagogue does not come from the ark but from its being a house of prayer. The Torah was brought into the synagogue for reading purposes.
I'm not sure if the majority of the first synagogues followed this idea and had the ark separate from the main prayer area. But, I haven't seen any shul that does not have the Aron Kodesh within the shul, itself. So, something changed at some point for some reason. When did that happen, and why was that change made?