I’m confused on this question could someone explain it more,

PB is a line segment on a number line. It has endpoints at -2 and 12 What is the coordinate of its midpoint?

the middle is just the average of the ends

(-2+12)/2 = 5
Note that
5 = -2+7
5 = 12-7
So it is right in the middle.