You should read articles on tangent space until you understand it before just randomly trying things. It will save you tons of time.

But the short answer is that the tangent defines part of the ‘tangent space’ coordinate axes along with the normal vector and binormal vector. You can think of these as x, y, z axis of the coordinate space on some point on the surface of the shape.

Without this, there is no way to know what the ‘normal’ vector data in a normal map means. Which way does normalMap(u,v).x point? Which way does normalMap(u,v).y point? etc… Who knows?!?

The tangent vector defines which way ‘x’ points. The binormal defines which way ‘y’ points. The ‘normal’ vector defines which way ‘z’ points.

From the normal and the tangent, the binormal can always be calculated because it’s always orthogonal to the other two.

In height map terrain, it’s pretty easy to calculate the tangent because it’s always going to be orthogonal to the normal and the z axis, ie: it’s the cross product between the normal and the z-axis. (Or z-axis and normal, I don’t remember the order off the top of my head but it’s easy to figure it out on a napkin.)

Edit: and if when reading that your are thinking “orthogonal what?!?” or “how did we get to cross product?!?” then I highly recommend brushing up on some basic 3D vector stuff before continuing.