Oil lubricates the moving parts of your engine. It keeps them cool by lowering friction and carrying heat away. It also keeps any grit or tiny particles from scratching tightly-fitted parts.
Heat breaks down oil. It can make the oil gummy or watery (or both), so that it doesn't lubricate properly. And the longer it's in the engine, the dirtier it gets.
Replacing old oil with new fixes all these problems. The fresh oil lubricates and cools better. When you flush the old oil out, you also flush away any grit or dirt in it.
Getting your oil changed regularly is probably the single best thing you can do for your engine. To reduce repairs and improve performance, follow your manufacturer's oil change recommendations listed in your owner's manual.