MagSafe as a technology actually dates all the way back to 2006, when Apple unveiled it as a magnetic power connector for the MacBook Pro. Apple ended up dropping the feature in favor of USB-C in 2015, but it eventually made its way back to the MacBook lineup.
You can still charge modern MacBooks through their USB-C ports at the same speeds you'd get with MagSafe, but you'll have to shop for a compatible USB-C cable separately. Apple bundles a USB-C to MagSafe cable with every MacBook, and it does offer its fair share of conveniences. For starters, charging your MacBook becomes as simple as bringing the MagSafe connector close to the charging port and letting the magnets snap it into place. Secondly, there's far less of a chance of your MacBook getting yanked off a desk if someone happens to accidentally trip over the charging cable — hence the name MagSafe.
As convenient as using a MagSafe cable for your MacBook is, it is a proprietary charging standard. This means you'll always be carrying around a dedicated cable that can't be used for anything other than charging your MacBook. A USB-C cable, on the other hand, can not only charge all of your devices, but it can also be used to connect external displays, hard drives and other peripherals to your Mac.
I remember almost exclusively using MagSafe for charging my MacBook when it was new and mostly docked at my desk, but the moment I started carrying it around, relying on USB-C just made more sense. It's also easier to justify buying newer USB-C cables since you know they'll come in handy for other devices, too.