from the picture, you can see there's two type of boxes which are oval and rectangle, the oval one indicate the factors inside the apple while the square one indicate that the numbers can still be divided
for the first one on the upper left,
54/2 = 27
since the number 2 can't be divided by any other numbers except the number itself,
thus , 2 is the prime factor
next,
since 27 can't be divided with 2, then we can try dividing it with 3 to find intiger
thus, 27/3=9
since 3 can't be divided with any number except the number itself, thus 3 is the prime number
this pattern follows for every question