Two ships leaving a port at different times and different speeds. When do they meet? Can someone please show me the working out to this word problem I have the answer but have no clue how to do the working out.

At noon ship A leaves port steaming at 8 knots 2 hours later ship B leaves same port on the same course steaming at 12 knots. 

How far from port will ship B overtake ship A? Answer(48 miles apart)

Show me the working out please.
First A goes 16 miles. Then B leaves, it takes some time to overtake A, let's say time $t$. In this time A travels $8t$ miles and B $12t$ miles. Given these we have that

$$12t = 16 + 8t$$
that is $t=4$. Hence the distance is $12t = 48$.
$S_1 - S_2 = S_3$ which is how many knots per hour so $S_3=t$.

$S_1 \times t = D$

$S_2 \times t = D$

$12 - 8 = 4$

$4 \times 12 = 48$ nm

$4 \times 8 = 48$ nm