The theorem that proves that the two triangles are similar is the SAS Similarity Theorem. The theorem states that if two sides of one triangle are proportional to two sides of another triangle, and the included angle between these sides is the same in both triangles, then the two triangles are similar.
In this case, the ratio of the corresponding sides of the two triangles are:
AB/DE = 3/18 = 1/6
BC/EF = 7/42 = 1/6
Since the ratio of corresponding sides is equal, and the included angle between them (angle B and angle E) is the same, the two triangles are similar by the SAS Similarity Theorem.