The left column is the cost, the gross profit and the selling price, top to bottom. On the right, the markup sits next to the cost and the margin next to the selling price; both come from the same gross profit. To keep the comparison clean, the example uses nothing but a cost and a selling price.
The profit is 20 either way
Cost 80, selling price 100: the gross profit is 100 − 80 = 20. Both percentages start from this same number.
Margin is 20%
Margin asks what share of the selling price is profit: 20 ÷ 100 = 20%. The selling price, 100, counts as 100%.
Markup is 25%
Markup asks how much was added on top of the cost: 20 ÷ 80 = 25%. The cost, 80, counts as 100%.
The same profit of 20 is divided by 100 in one case and by 80 in the other — hence 20% and 25%. Both are correct; they just measure against different bases.
The same "20%" gives different prices
Now go the other way and set a price from a percentage. Keep the cost at 80 and aim for 20%.