Persia, in taking over western Asia, gained control of the Greek city-states located there. When these cities revolted in 499 BCE, cities from mainland Greece intervened, which led the Persians to believe that the only way to achieve peace within their empire was to incorporate those European Greek cities within their empire.
The Persians bought compliance from some of these cities and set out to conquer the rest. Their invasion of mainland Greece in 480-479 failed, and Athens formed the Delian League of a couple of hundred cities mainly from Asia Minor and the Islands to retain the freedom they had achieved. Sporadic warfare continued until in 449 BCE the Persians gave up, agreed to stay away from the cities, and left the Greeks to go back to their usual warfare between each other.
Athens opportunistically then turned the League into an empire of its own - they ruefully realised they had traded an alien master for another master whom they had mistakenly trusted.