The reason these ants are known as “carpenter ants” is because of their propensity for wood. Unlike termites, they don’t actually eat the wood. They simply bore through it for shelter and to travel.
They actually eat similar things to other ants: sweet fruits, crumbs, food products, pet food, meats, etc.
Carpenter ants are larger than most other species, so if you see ants that look big to you, they may be carpenter ants. It is easier for them to bore through soft or damp wood, so keep an eye out for them so you won’t need a carpenter ant treatment, which can get expensive.