It comes from the word "barbacoa" which referred to a framework used by the Taíno people for smoking and roasting meat over a fire. This framework was often built on a raised platform, typically made of green wood.
The Spanish explorers adopted the word "barbacoa" and brought it back to Europe, where it eventually evolved into the English word "barbecue".