Why do defenders cost less?

I’ve never understood why the most expensive defender in footballing history is half the price of the most expensive attacking player in the history? Are they not just as important?