This is a consequence of the properties of integration, which is a large sum of infinitesimally small areas. When dealing with a continuous random variable $X$, the probability that it falls within an interval is given by the integral of the probability density over that interval:
$$\mathbb{P}(a \leqslant X \leqslant b)
= \int \limits_a^b f_X(x) \ dx.$$
One of the properties of the integral is that if you integrate over a single point, you get an infinitesimal value, which is indistinguishable from zero within the normal number system. To understand this property, you would need to learn a bit about integrals and infinitesimals, which is something covered in calculus courses (though coverage of explicit use of infinitesimal methods is something usually reserved for specialist courses). One interpretation for the phenomena you are examining is that an integral is a large sum of infinitesimally small areas with base length $dx$ and height $f_X(x)$ at each point $x$. Taking $dx$ to be an infinitesimally small quantity, we can then think about the integral explicitly as a sum of infinitesimally small quantities:
$$\mathbb{P}(a \leqslant X \leqslant b)
= \sum_a^b f_X(x) \cdot dx.$$
One of the properties of the integral is that if you integrate over a single point, you get an infinitesimally small value, which is indistinguishable from zero within the standard number system:
$$\mathbb{P}(a \leqslant X \leqslant a)
= f_X(a) \cdot dx = 0.$$
(The second equals sign here reflects the transition from considering infinitesimal quantities to transferring back to the domain of the standard number system.) The resolution of the issue you are considering comes from recognising that large sums of infinitesimals can be non-infinitesimal. When looking at these from the perspective of the standard number system (where infinitesimals are indistinguishable from zero) this means that an integral can be zero over a point but non-zero over a larger interval.
Note for mathematics pendants: In the above exposition I am attempting to give an intuitive answer for a non-specialist, so I am glossing over the transition between standard calculus treatment within the real number system (e.g., using the Reimann integral) and the treatment of same within a hyperreal number system that includes explicit infinitesimals. See Keisler (2022) for technical details building up the integral with explicit infinitesimals (esp. pp. 59-64).