They have multiple fuel tanks, which can hold a large amount of fuel.
The amount of fuel a commercial plane can carry depends on the size and type of plane.
For example, a Boeing 747-400 can carry over 24,000 gallons of fuel, while a smaller plane, like a Cessna 172, can carry only about 50 gallons.
The amount of fuel a commercial plane needs depends on the length of the flight, the weight of the plane, and the weather conditions.
A longer flight will require more fuel, as will a heavier plane.
Headwinds can also increase the amount of fuel needed.
For these reasons, commercial planes typically carry more fuel than they need, in order to account for unexpected delays or changes in flight conditions.