There is a difference between primitive physical quantities and physical quantities whose units are base units.

The primitive physical quantities are those quantities that in a theory of physics cannot be defined as functions of other previously defined quantities.

Therefore any theory of physics starts from a list of primitive physical quantities and the other quantities are defined using the primitive quantities.

Sometimes, during the evolution of physics, previously unknown relationships between quantities are discovered, which cause a previously primitive quantity to be defined now using other quantities, so in the updated theory the number of primitive quantities is reduced.

The most important examples of such cases are the discovery caused by the Oersted experiment that the magnetism is also produced by the electric charge and not by a distinct magnetic charge and the discovery as a consequence of the atomic theory and of the statistical physics that the temperature is not a primitive quantity but one that can be defined based on the distribution of the kinetic energy of an ensemble of particles.

Examples of primitive physical quantities are time, length and force.

When you establish a system of units of measurement for the physical quantities, some units are chosen arbitrary and are designated as base units. The other units are derived from them using the relationships that exist between physical quantities during various kinds of experiments.

What confuses many people, including you, is that there exists absolutely no relationship between the quantities that are primitive and the quantities whose units are chosen to be base units.

In a theory of physics, the number of primitive quantities is fixed, but the number of base units is completely arbitrary.

There might be e.g. 10 primitive quantities, but one may choose to have 0, 1, 2, 10, 20 or 50 base units.

Having too many base units makes the computations inconvenient, because in each relationship between quantities an extra base unit may introduce an extra arbitrary multiplication factor, a.k.a. "universal constant".

The systems with too few base units are disliked by many people because the units for many frequently used physical quantities become either very large or very small in comparison with the usual values, or they just become too different from the traditional units used for those quantities.

So the SI is a balance between these 2 conflicting requirements. It has much more base units than necessary but much less than the traditional systems of units that existed before SI.

The base units are chosen so that it is possible to make some devices that realize the units with high accuracy and precision.

Because of this requirement, the quantities with base units are very seldom also primitive quantities.

For a very long time, the length was both a primitive quantity and one whose unit was a base unit, because you could choose some stick or rod as the base unit for length.

Because any object has a length that is variable in time when measured with high precision, this had to be abandoned and the length does not have a base unit now (in reality it does not have a base unit, even if the SI definition attempts to preserve the illusion that the length still has a base unit).

For time, it was never possible to keep with you a certain time so the base unit has always been not for time but for the period of a periodic system or, equivalently, for its frequency. In the beginning the periodic phenomenon was the rotation of the Earth, then it was the revolution of the Earth around the Sun, then an atomic clock. The unit of time has always been derived from the unit of frequency (or of period).

The confusion for those who are not aware how the systems of units of measurement work is greatly enhanced by the definitions of the SI units, which, in an attempt to reduce the confusion (?!) define the units for the same physical quantities that were chosen to have base units at the creation of the SI, even if in fact most of them no longer have true base units.

Even at the creation of SI, the time was named as a quantity with a base unit just because it is well known as a primitive quantity, even if the actual definition defined the time unit as derived from the unit of period and later from the unit of frequency.

Today, the SI is obtained from a simpler system with much less base units by taking the derived units of various quantities, multiplying them with arbitrary factors chosen so that the new SI units match the older SI units and setting these multiplied units as the base units of the current SI.