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.