Claudius Ptolemy was a great ancient astrologer (among other things) who lived in the 1st and 2nd centuries CE. He wrote a four-volume treatise about astrology and its techniques, called the Tetrabiblos, which is still one of the most fundamental texts on which modern astrology is based.
Ptolemy advocated using a particular group of planetary aspects, consisting of the conjunction (0°), sextile (60°), square (90°), trine (120°) and opposition (180°).
These are known as the Ptolemaic aspects, or major aspects, and are based on the element and modality relationships between signs.
For example, planets close to the same degree in signs that have the same element have a trine aspect (120°). This indicates an easy-flowing energy between the two planets, usually beneficial.
Signs with different but compatible elements (Fire and Air, Earth and Water) are in sextile. Compatible elements have the same polarity, so Fire and Air are "Yang" and compatible, and Earth and Water are "Yin" and compatible. Sextile aspects give a creative potential to the planets involved. Their similarity (polarity) gives them a common ground, but the fact that the elements are different means you have to apply effort to get them to work together.
Signs that have the same modality (Cardinal, Fixed, Mutable) are in square or opposition to each other. These are dynamic and motivating energy, particularly related to the modality involved, and also tend to be triggered by conflict or problems.