What causes a computer to slow down over time?

Over the past year, my desktop has become much slower when opening programs and files. I haven’t changed any hardware, but it feels like everything takes longer to load now.
What are the main reasons a computer slows down with time, even if you don’t install much?