Start with one fact: a 3-4-5 right triangle satisfies 32+42=52. Replace the numbers with letters and you have the Pythagorean theorem, a2+b2=c2, for every right triangle. Now drop the word 'right': for any triangle with angle C between sides a and b, the Law of Cosines says c2=a2+b2−2abcosC. When C=90∘ the extra term vanishes, because cos90∘=0, so the old theorem sits inside the new one. That is the usual shape of a generalization: constants become variables, a condition is removed, and putting the condition back recovers the original result.
A general claim needs a reason, not just more examples. The sums of the first n odd numbers are 1, 4, 9, 16, 25, which suggests n2. The reason shows up in a picture: arrange n2 dots in a square, and the next odd number, 2n+1, is exactly the L-shaped strip that turns an n-by-n square into an (n+1)-by-(n+1) square. That picture works for every n, which no list of cases can do.
Generalization runs in the opposite direction from specialization. Putting C=90∘ into the Law of Cosines narrows a general law to one case; building the Law of Cosines from the Pythagorean theorem widens a special case into a law. It also differs from guessing: noticing that 1, 4, 9 are squares is a conjecture until you show why the pattern must continue.
Think of it like this. Generalizing is like turning a recipe for one chocolate cake into a template recipe with blanks: any flavour, any tin size, baking time set by depth. Filling the blanks with chocolate and 20 cm gives the original cake back. Stretch the template too far, to a cake two metres wide, and it fails, just as a widened claim can lose a condition it needed.
Core idea. Generalization extends a specific result to a whole class by replacing fixed values with variables or removing restrictions.