It’s easy to forget that Athens didn’t have a harbour on its doorstep. Instead a site 12km to the southwest (which had been inhabited and used for millenia) was identified by Themistocles in the 490s BC. This was developed, further fortifications being added before the famous Long Walls (which were added from the 460s onwards).
The map shows Phaleron, which was the previously used harbour and it’s easy to see the advantage the Piraeus had over it.