Both remove material you don't need. Only one of them also questions the shape, the manufacturing process, and the material you started with.
Software vendors use these two terms almost interchangeably in marketing copy, which is part of why engineers conflate them. Both start from a design space and loads, and both output organic, load-following shapes that look distinctly different from what a human designer would sketch by hand. The actual difference is in scope: topology optimization solves one well-posed math problem — where should material go, within one fixed mesh, one material, one manufacturing assumption, to minimize compliance (or another objective) at a given mass fraction? Generative design runs that same kind of optimization many times over, systematically varying the manufacturing method, material, and sometimes load case, and hands back a set of distinct design options rather than one answer.
Topology optimization, in its classic form (SIMP — Solid Isotropic Material with Penalization — is the most common algorithm), is a single mathematical optimization: given a fixed design space, boundary conditions, loads, one material, and a target mass or volume fraction, find the material density distribution that minimizes compliance (maximizes stiffness) or meets some other stated objective. It runs once per setup and outputs a density field that has to be manually reinterpreted — smoothed, re-meshed, checked against manufacturing constraints — before it becomes a real part. Generative design, as implemented in tools like Fusion 360's Generative Design workspace or nTopology, wraps that same core optimization in an outer loop: the engineer specifies preserved geometry, loads, and a set of candidate materials and manufacturing methods (cast, 3D-printed metal, 5-axis milled, sheet-formed), and the software runs the underlying optimization once per combination, automatically respecting the manufacturing constraints specific to each process (draft angles for casting, minimum wall thickness for printing, tool-accessibility for milling). The result is a study of several distinct, already-manufacturable candidate designs the engineer can compare on mass, stiffness, and cost — rather than one shape that still needs translating into something a shop floor can build.
The visual output can look similar — both produce organic, load-path-following shapes very different from what a human designer sketches by hand — but the scope of what's actually being searched is different, and that changes what the output means. A single topology optimization run answers "where should material go, given everything else fixed?" and its result is only as good as the single manufacturing assumption baked into that run — if you set it up assuming 5-axis milling and then decide to cast the part instead, the optimized shape may no longer even be manufacturable (internal cavities a mill can't reach, no draft angle for the mold to release). Generative design deliberately varies the manufacturing method and material as part of the search, so its several outputs are each already consistent with the process they assume. Treating a single topology-optimization output as if it already accounted for manufacturability is a common way unbuildable geometry ends up in a design review.