Nip in the bud comes from horticulture, where trimming a bud from a plant prevents the bud from becoming a flower or fruit. Used metaphorically, the phrase usually means to stop a potential problem before it develops. For example, you might nip an argument in the bud by coming to a compromise immediately, or you might nip an illness in the bud by taking medicine as soon as you feel symptoms.
Some plants thrive when buds are selectively nipped—even when the nipped buds are not especially harmful—so a slightly different metaphorical meaning of nip in the bud would be to end something early for the sake of a greater good. But the phrase is usually used in the first sense.
Photo by wackybadger - http://flic.kr/p/7ZcTba