According to the ancient Athenian founding myth, Athena, the goddess of wisdom, competed against Poseidon, the god of the seas, for patronage of the yet-unnamed city. They agreed that whoever gave the Athenians the better gift would become their patron and appointed Cecrops, the king of Athens, as the judge.

According to the account given by Pseudo-Apollodorus, Poseidon struck the ground with his trident and a salt water spring welled up. In an alternative version of the myth from Vergil's Georgics, Poseidon instead gave the Athenians the first horse. In both versions, Athena offered the Athenians the first domesticated olive tree. Cecrops accepted this gift and declared Athena the patron goddess of Athens.

More Info: en.wikipedia.org