Ylides will add to aldehydes/ketones and produce alkenes. Triphenylphosphine oxide is produced as a by-product. This is known as the Wittig reaction or Wittig olefination. Another name for an alkene is an olefin. Wittig is pronounced "Vittig", since it is German.
There are different types of ylides (phosphorus, sulfur, carbonyl). The Wittig reaction utilizes triphenylphosphonium ylides. A ylide has a positive charge next to a negative charge. Take a look at the resonance structure on the left below. I like to draw them like this because it shows that the C atom has lone pair and negative charge (i.e. it's nucleophilic).
An alkyl halide (usually a bromide) is treated with triphenylphosphine (PPh3). PPh3 is an excellent nucleophile and undergoes SN2 reaction with the alkyl halide (step 1). Because of this initial SN2 step, primary alkyl halides work best, secondary halides are possible (slower), and tertiary halides can not be used. This forms an intermediate phosphonium ion. This intermediate is then deprotonated with a powerful base, such as butyl lithium to produce the ylide (step 2).
There are two extremes in ylides. Ylides derived from alkyl halides are considered unstabilized.
For example, the following ylide is unstabilized.
Unstabilized ylides yield primarily Z-alkenes in the Wittig reaction.
Stabilized ylides have an electron-withdrawing group (EWG) connected to the ylide carbon. For example, the following is a stabilized ylide. It is stabilized because of resonance. Some stabilized ylides are so stable they can be isolated and stored.
Stabilized ylides produce primarily E-alkenes.
The nucleophilic carbon of the ylide attacks the carbonyl carbon of the aldehyde. This produces a betaine intermediate. The betaine quickly converts to the cyclic oxophosphetane intermediate. The stereochemistry is controlled by the geometry of this oxophosphetane intermediate. With unstabilized ylides, the syn-oxophosphetane is the primary intermediate (shown below). Notice that the two ethyl groups are cis in the oxophosphetane ring and the OPh3 is eliminating in a syn (same face) fashion to produce the alkene. This elimination is believed to be a concerted elimination. Elimination results in the alkene and triphenylphosphine oxide (OPPh3).