Theory:

Need for Epicycle model:
The following are the reasons for the Epicycle model.
  • Why was the brightness of the planet changing?
  • Why was the directions changing (Retrograde motion)?
Retrograde motion
Retrograde motion is the possible motion of a planet in a direction adverse to that of other bodies within its system, as observed from a particular vantage point.
Example:
If we were examining the planet's motion in the month of January, it would seem to move eastward in the background stars. That is the position of that planet's today will be near a star which is east of the star near which it was yesterday. However, on June 28, we will witness a shift. From that date, that planet would appear to move west rather than its normal eastward motion. This reversal of direction of planets is called as retrograde motion.
Epicycle Model
It is used to explain the variations in speed and direction of the celestial objects (objects in space such as the sun, moon, planets and stars).
 
Ptolemy (\(2\)nd century) in Greece, Aryabhata in India and others used the epicycle model to describe the celestial objects' motion.
 
 shutterstock_1591822702.jpg 778pxAryabhata51jpg.jpg

Astronomers like Tycho Brahe and Neelakanta Somayaji enhanced this model even though due to more mismatches, it became messy.
Reference:
Free image credit:
https://commons.wikimedia.org/wiki/File:Aryabhata-5_(1).jpg