The bitterness in ampalaya is caused by a group of compounds called cucurbitacins. These compounds are also responsible for the bitter taste of other vegetables, such as cabbage and Brussels sprouts. Cucurbitacins are thought to have a protective role in plants, deterring animals from eating them.