Glyburide is in a class of medications called sulfonylureas which stimulate beta cells within the pancreas. The beta cells are responsible for responding to spikes or drops in glucose. When you eat a meal, your blood glucose will increase which activates your beta cells to release insulin to then lower your blood glucose and vice versa. When you have diabetes your beta cells may lose some or all of their ability to tightly control blood glucose. So all of a sudden when you start taking glyburide, enough insulin is released to push glucose into you bodies cells. Therefore, any excess glucose that is taken up into cells that is not immediately needed for energy is stored in the form of fat for later use, hence weight gain.
The body turns carbohydrates to Blood Sugar (BG) insulin helps get the BG into the cells of your body where they use it for energy. and store excess energy as fat. Diabetics dont make enough or cant use the insulin we make, by taking Glyburide it forces the pancreas to make more insulin. This allows the cells to use the BG and store more BG as fat thereby lowering BG.