When you click on a magnet link, it connects you directly to other users who have the file and are currently sharing it. A torrent file contains information about a file you open with a torrent client. Magnet links are better if you're on mobile, as you can download them directly without worrying about managing files.