So what the heck is "game dumping?"

I've seen alot of people mention "dumping" games, mostly switch games, onto a Steam Deck. Isn't that somewhat illegal? If not, how does it work?