WD-40 acts as a lubricant, reducing friction in hinges and locks, making doors easier to open and close.