She had $24 and had left $10. We subtract to find out the amount of money the pencils cost.
$24 - $10 = $14
She spent $14 on the 7 pencils. Now we divide the total amount spent ($14) by the number of pencils (7) to find out the amount each pencil cost.
$14/7 = $2
Each pencil cost $2.