There are two kinds of time in astronomy, solar time and sidereal time.
Ordinary clocks, and most people on earth use solar time, based on Earth’s rotation and orbit in relation to the Sun.
The foundation of sidereal time is Earth’s rotation only, in relation to stars other than the Sun. Neither method of keeping track of time is more accurate than the other.
They are simply two different methods of organization.
A solar day is 24 hours long, but Earth actually takes only 23 hours, 56 minutes, and 4 seconds to make one complete rotation on its axis.
Because of the orbital distance Earth travels over the course of one axial rotation, it takes an extra 3 minutes and 56 seconds for the Sun to appear in the same place, at high noon, in the sky every day.
The length of a sidereal day disregards this orbital distance and equals exactly one Earth rotation: 23 hours, 56 minutes, and 4 seconds.
According to solar time, the stars appear in the sky approximately 4 minutes earlier with every passing night.
Using sidereal time, the same stars appear in the same place at the same time every night.