Words can be like little time capsules, and 'rake' is one of those that carries a few different histories inside it. The basic sense—the gardening tool for gathering leaves or smoothing soil—goes back into Old English and other Germanic languages. Linguists usually trace it to a Proto-Germanic root that meant something like 'to scrape or gather,' which also shows up in German as 'Rechen' (a rake). So the physical tool and the verb 'to rake' (pulling or gathering by dragging) are the oldest senses and feel very literal: you scrape, you collect, you smooth.
What I find fun is how that literal image turned into a human character type. By the 1600s and 1700s English speakers started using 'rake' in the social sense—short for 'rakehell'—to describe a dissolute, pleasure-seeking man, basically someone who metaphorically 'rakes' through life, women, or vices. That sense is a figurative spin-off from the physical action: the rake stirs things up, and so does a libertine. There's also a technical theater/architecture use—'a raked stage' meaning sloped—which again grows from the basic motion of angling or pulling. Language branching like that always makes me smile.