What would be the advantages of using something such as say Unity over Game Maker? Is it just easier to code?
All canned engines like Unity, Game Maker, RPG Maker, Multimedia Fusion, etc have some kind of core game type in mind that they work best for, even if they claim they are ready for any game idea you can come up with. They are all more hassle-free than rolling your own engine, but the downside is inevitably you will want to implement a game feature that the engine just wasn't designed for and have to do crazy workarounds to get it to work.
Game Maker and MMF seems best for classic 2D games, particularly platformers, RPG Maker is obviously made for JRPGs. Unity was clearly designed for 3rd-person 3D action adventures with staticly-populated maps (trust me, at my previous job a lot of our games involved dynamically-spawned enemies with various randomly-generated stats in a single map, Unity was NOT built for that and we got it to work but it took a lot of workarounds and custom plug-ins).
That doesn't mean you can't make a wide variety of other types of games, it just means you need to do a little extra work to get them to do what you want when you go outside of the core game styles the engine's developers had in mind. The ones that offer plug-ins really help that process (one of the things that helped Unity become popular, though I personally believe having a free version that had the majority of features available and option to publish without ever paying Unity a dime is the biggest contributor to their initial success).
Of course you are also restricted to what platforms that engine is built for, so that's something else to consider.
I spent a long time working with RAD (rapid application development) tools like Unity and its many predecessors from other companies for my hobbyist game projects, but eventually I grew tired of dealing with crazy workarounds or spending hours debugging a problem only to discover it was an issue with the engine and not my game code. I wanted an engine to do exactly what I wanted to do and nothing more or less, so, after reading an interview with Jonathan Blow (Braid) where he made some good points about the advantages of using straight c++, I decided to just make my own engine (though used an open-source framework as a starting point to get past the hardest stuff quickly - I'm not crazy enough to start from scratch!).
It sucked a lot of time away from actually developing the game, doing tech support for it really sucked as I mentioned earlier, and we're still working on getting it ported to other platforms that would have been available out-of-the-box if we had went with Unity or the like. I often wonder if it was a mistake to do it, but every once in a while I see someone complaining about how their engine of choice is doing something weird and they can't figure out why its doing it or how to get around it, and I'm reminded how I have 100% access to all the code that is running my game and engine so anything that goes wrong I can debug it down to the most basic level myself, or change the engine's functionality to suit the current game's needs at will, and that makes me feel better about doing it the way I did. Plus, hey, a friend of mine got Volgarr working on the Dreamcast - try THAT with Unity .
That said, I would not suggest anyone try to roll their own engine unless you are like me and have been programming for years and years (I'd been a hobbyist programmer for over 25 years myself, with 7 of those as an in-industry professional, before I tried using a custom c++ engine).