How do you check if two objects WOULD collide if their trajectory reimains the same?

Is there any build-in function? If not, could you explain me the principle?
Example: Two cars running at different speeds on two different streets which at some points cross. Can you know when & where would they collide if the drivers don’t break?

if you approximate your objects as spheres,
then you can set this up algebraicly.

T0 = time now
RA = radius of sphere A
RB = radius of sphere B
VA = velocity vector of A
VB = velocity vector of B
PA0 = position of sphere A at time 0
PB0 = position of sphere B at time 0
PA(t) = PA0 + VA * (t - T0)   // position of A at time t
PB(t) = PB0 + VB * (t - T0)   // position of B at time t
    
want to find:
TC = time of collision, if any.

so you want to find the moment when the distance between the spheres is exactly equal to the sum of their radii. ie, solving for TC in this formula:
magnitude(PA(TC) - PB(TC)) = RA + RB.

when you solve for TC you will get 0, 1 or 2 real solutions.
if you get 2 solutions, the lesser of them is the moment of collision.
if you get 1 solution (unlikely) then they just graze each other.
if you get 0 solutions they don't collide.

this approach does not deal with the case where the two spheres are already overlapping.

Maybe this could help you - Unity - Scripting API: Rigidbody.SweepTest. with some math added

You could use a Raycast with x distance, if the trajectory remains the same eventualy the ray will collide with the other car, just set the direction of the ray to the other object you want to check if a collision is imenent.