Why do f1 racing cars always go to the pitstop?

A formula one car consumes a lot of fuel and also the tires of a F1 car does not usually last one full race distance. The pit is the place where the car comes to fill up fuel and change to new sets of tires. The pit stop usually lasts for around 10 seconds or less in which a team of mechanics change the tires of a F1 car and refuel it to continue the race.