The Ancient Olympics were first held in 776 BC. Athletics were an important part in religious festivals for the ancient Greeks. The people of Greece believed that the athletics they played during their religious festivals pleased Zeus, the king of gods. They were held in a scared valley at a place called Olympia.
The Olympia is a valley that is about eleven miles from Pirgos. The Olympic games were held there every four years. The games were so important to the Greeks that they used the four year rotation as the basis for their calendar. The Olympiad was their way of telling time. It was the period of four years between two festivals of the Ancient Olympic Games.
There are many interpretations of how it all got started. One way said was "One Greek legend said that the great Hercules won a race at Olympia, and then decreed that the race should be re-enacted every four years" (quote from website).
Another story is that the Olympic festival was a local religious event until 884 BC, and the king of Elis decided to make it more open to a pan-Hellenic festival.
The Olympic festival was pretty much a religious gathering to celebrate the gods worshipped by all of the Hellenes. Zeus was the main god celebrated though. There were three other major festivals that all included fairs but the Olympia became to most popular. In about 572 BC Elis and Sparta made an alliance in which Elis was in charge of the event and Sparta was in charge of the sacred truce.
The only event at the Ancient Olympics was a single foot race until the fifteenth Olympiad. More sports began to start at that point. Wrestling started in 708 and boxing began in 688. Chariot racing was in 680.