It seems like it is assumed that these angles will always be 90 degrees but if this is true then why do u and v make perfect sides of a right triangle every time? Is this just a coincidence or is there a reason?

It seems like it is assumed that these angles will always be 90 degrees but if this is true then why do u and v make perfect sides of a right triangle every time? Is this just a coincidence or is there a reason?

On
$u$ and $v$ are the projections of $w$ in the directions parallel and perpendicular to the indicated line. By definition, they are perpendicular--the angle between them is a right angle (assuming neither projection is $0$).
Another way to see this is to realize that $w$ is the diagonal of a unique rectangle, and the angles in a rectangle are all right angles.
In an inclined plane problem, the weight force on the mass is defined as acting "vertically downward". However, the forces that influence the motion of the mass acts along the surface of the plane, and perpendicularly to that surface.
The acceleration of the mass along the surface is the resultant of the component of the weight or gravity force and any frictional force, both acting along the surface. The frictional force is modeled as being a multiple (the coefficient of friction) of the "normal" force, which is the component of the weight force which is perpendicular to the surface.
So it is useful in this physical model to "resolve" the weight force ( $ \ \vec{w} \ $ in this diagram) into the so-called "parallel" ( $ \ \vec{u} \ $ ) and "perpendicular" ( $ \ \vec{v} \ $ ) components.