This has been answered before, but I chose not to just mark it a duplicate because there is one new reason for the header tank unique to Starship.
In a Reddit AMA in 2017 where Elon Musk answered questions about the original ITS design, he answered a question about the header tanks:
Those are the header tanks that contain the landing propellant. They are separate in order to have greater insulation and minimize boil-off, avoid sloshing on entry and not have to press up the whole main tank.
Elon Musk Explains reason for the header tank in the old ITS design
In other words, if you just leave enough propellant for landing in the main tank, it will slosh around the mostly empty tank, screwing up the handling of the vehicle. And to pressure feed the engines they would be required to keep the main tank pressurized right until landing.
Much better to move the fuel for landing to a smaller tank, run the main tank dry on ascent, and then you have a completely full, much smaller tank to deal with for landing. That strikes me as a much better way to go, and clearly SpaceX feels that way as well.
Musk also mentions that the smaller tank can be better insulated to avoid boil-off of the cryogenic fuel. This is important for the landing fuel, because unlike the main fuel which is gone in a few minutes after takeoff, the landing fuel has to remain in the vehicle until the mission is over and it returns. Why insulate a gigantic tank to protect 10% of the fuel, when you can just insulate a separate header tank?
Now, the new reason for the Starship header tank is that by putting it in the very tip of the nose of the Starship you move the center of mass higher on the rocket - especially during reentry. If the fuel was in the main tank, the weight and balance would be too far aft for the 'skydiver' horizontal return method. So putting a separate tank in the nose of the Starship solves a whole lot of problems at once.