A lot of people have questions like this, and when people start reviewing math again for the GMAT, it's in these kinds of situations where mistakes are most common. When you are canceling in a fraction, anything you cancel must be a factor of the entire numerator and of the entire denominator. So if you want to cancel something, you must be able to rewrite the numerator and denominator as products, where the thing you're canceling is part of each product. So in the basic case, with numbers:
8/36
We can rewrite the numerator and denominator as products, both containing the number '4':
(4)(2) / (4)(9)
and now we cancel the '4' to get 2/9.
The algebraic case is similar. I'll give one example where we can factor and cancel (using quadratic factoring) :
\(\frac{x^2 - 7x + 12}{x^2 - 5x + 6} = \frac{(x-3)(x-4)}{(x-3)(x-2)} = \frac{x-4}{x-2}\)
Notice we can cancel the "x-3" because it is part of a product in both the numerator and denominator. Or in this case you can cancel:
\(\frac{ab + ac}{ab - ac} = \frac{(a)(b+c)}{(a)(b-c)} = \frac{b+c}{b-c}\)
because "a" is a factor of both the numerator and denominator. But in cases like this, say:
\(\frac{xz + y}{xz - y}\)
no cancellation is possible, because there is no identical factor we can create in both the numerator and denominator (in fact there's no factorization we can even do here). So even though the numerator and denominator appear quite similar here, that is no guarantee that any cancellation will be possible - you need to see what factoring you can do.
Factoring is one of the most useful techniques in all of algebra, so if it's something you're not completely comfortable with yet, I'd suggest practicing it a lot, because it's a crucial skill for GMAT math.