Trigonometric values (sin, cos, tan etc.), represents the ratio between two sides.
In this case the triangle is dilated, which means the size will change but the shape will stay proportional.
Because the sides grew proportional their ratio stays the same; so, the tan in the second triangle is 22/5 too.
Moreover, because the sides grew/shrunk proportional, the angles stay the same.
Because same angles have the same trigonometric values, tan(x) in second triangle becomes 22/5.