I think you are asking why we calculate percent profit or loss as a percentage of cost price, that is, by dividing the amount of profit or loss by the cost (that is "writing it over the cost", or calculating it relative to the cost).
That is simply what you do if you choose to do that calculation. You can also find the percentage of selling price; that is called the margin. Both are valid calculations.
If you want to know when you would use each of the two calculations, and why, I'll leave that to the finance people here.