With an AR-15, when the trigger is pulled and the bullet travels down the barrel, the rifle uses some of the hot gas to cycle the action.
This begins with those hot gasses entering the gas block from the gas port of the barrel, traveling down the gas tube, pushing the bolt carrier back, and extracting the empty casing.
As the bolt carrier group moves rearward and the casing is ejected, the buffer and buffer spring inside the stock assembly compresses, slowing the bolt to a stop and returning it to the forward position.
As the bolt returns forward, the magazine lines up a new round to be fed into the chamber and the bolt catches it while returning to the forward position.
The gas system is composed of the gas block and gas tube. There isn’t much you can do with a gas tube, it’s a steel tube and the way it affects the rifle is generally tied to its length.