Traps in Natural gas lines?

If you look at any gas appliance in your home, you will notice that the gas line has a short vertical section of pipe, below the line into your water heater, stove, furnace, etc. What is the function of this trap? Does gas contain particles that would be drawn into the burners otherwise? I happened to notice this, as a plumber was installing a new water heater in my basement. Anybody know why these are fitted to the gas lines?

It’s called a dirt leg. They are placed at the bottom of a vertical run to catch any solid particles that might be in the gas.

I’ve never opened one up to see if they actually catch anything, but I have cleaned out a strainer in a gas line and that did have some grit in it. So I guess that a properly installed dirt leg probably works.

In addition to dirt, they also serve to catch any water that might be in the line. Unles you’ve got a really bad gas supply, that’s probably going to be a one-off operation to trap water that might be in the pipes from when they were assembled, as opposed to an on-going collection of water.