It can be a bit of everything.
You can have mods to fix some bugs, to add new features that players want, to improve graphics, it's modifying the game to make it do things you wish it did.
In my exemple I'm a modder myself who focuses mostly on levels / environments. I did multiple ports and expansions of tony hawk levels for Tony Hawk's Underground Pro on PC, which is actually already a mod of Tony Hawk's Underground 2, allowing people to play together online on almost on the levels from the series. I did modding inside a mod
Lately I've been working on this:
I've always been incredibly disappointed by the fact that Final Fantasy XV doesn't include much of the city of Insomnia, which was what a lot of us were looking forward to with Final Fantasy Versus XIII / Final Fantasy XV. I decided to start a project to collect all assets I could use from the game and edit them to rebuild a version of the city I would like, and build that "Versus XIII" game that we never got, inside Kingdom Hearts III instead, because of how close the projects actually are.
About how it's done, it really depends on the game. Some stuff can be done from scratch if the person behind the mod know what they're doing and manage to improvise something, depending on the game files format / engine etc, there can be some generic tools for some stuff too.
Most of the times though, you will need some specific tools to be able to do big mods that go in depth into modifying the games. Such tools can be provided by the devs officially sometimes, but that's rare, and most of the time it's the community who will create tools to allow other people to create mods, it's a community effort.
In my case, for my Tony Hawk levels, it was all done inside Blender (3D software) directly, because someone made a plugin for it which can read the game's level file format, import them into blender, or export your own 3D scenes as levels for the game, with different features to let us add specific triggers on different surfaces, make path nodes to allow grinds etc...
In the case of Kingdom Hearts, I build the city in Blender, but the project is possible thanks to a customized version of Unreal Engine that was put together by people in the KH Modding community. This version of unreal engine is using the same version as the one Square Enix did to make KH3, with different features to do actions specific to this game. On top of this, I was able to collect assets from FF XV thanks to another person who created a tool to explore and export assets from Final Fantasy XV. As you can see, it's really the effort of multiple people put together, everyone doing something in a modding scene can help others build on top of that or use their work for their future mods.
It's usually not really about modifying the "code", although there can be such things, especially modifying scripts, but most of the time it's using specific tools. I for example don't know anything about programming, I'm more of an "artist" person, and I wouldn't be able to do the things I did without other modders placing the first stones for me to build upon.
Mods are free 99,99% of the time. You have exceptions like when Bethesda tried to push paid mods, but usually the most you will see are people accepting donations from people who want to support a mod, and that's it.
You can have several mods, but once again it really depends on the game, in the early days of tony hawk level modding for example we could only do custom levels by replacing existing ones, so it two custom levels replaced the same one, you wouldn't be able to have both at the same time, but now we can have our own custom list of brand new levels. It's a case by case thing, modding isn't the same on all the games at all, this would be really easy otherwise if there was some kind of universal tool for all games, it's sadly not the case lol.
If no tools were made and you don't have the knowledge to make one yourself, some games can't be modded at all beyond post process things like reshade, if you consider that modding.
About sueing, it rarely go that far but cease and decist letters are very common depending on the project sadly, especially if it's a very big mod that actually end up going into the fan game category. It really depends on the publishers, some are fine with modding and will let you do what you want, Square Enix for example also provided some tools for FF XV on PC too, but some other publishers will be very lame about it, Rockstar for example is trying to stop the mods related to AI NPCs in GTA V these days.
Sorry for the big wall of text
I hope it answers some of your questions.