Dot product is in games used mostly to determine the inclination of a direction vector in respect to another direction vector, i.e. how “similar” their directions are. It can be used to calculate the exact angle between them at the cost of an additional trigonometric function call, but the exact angle is not necessary in many cases.
By definition:
dot(a,b) = length(a) * length(b) * cosine_of_angle_between_a_and_b
If both vectors are normal vectors, i.e. their length is 1 then is boils down to simply:
dot(a,b) = cosine_of_angle_between_a_and_b
It’s directly equal to the cosine of the angle between two vectors. Since the dot product can be calculated simply by multiplying and adding the components, it lets us cheaply calculate the cosine of that angle.
What’s useful here is the fact that if the directions coincide, the dot product will be exactly 1. If they are perpendicular it will be exactly 0. For angles inbetween it will be some value between 0 and 1. If the vectors face in “opposite” directions the dot product will be a negative value between 0 and -1.
So to summarize; if vectors are facing in the same direction, the dot product it will be 1, if they are perpendicular it will be 0, and if they are facing away from each other, it will be -1.
This is very useful in many situations.
If you need an exact angle between the vectors, simply do an inverse cosine of the dot product, which is precisely what functions like Vector3::angle_to() do under the hood.